Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
reduce, convert char to number solution in Clear category for Surjection Strings by akaka
const toNum = (line, char, num) => {
return line.replace(new RegExp(char, 'g'), String(num))
}
function isometricStrings(l1: string, l2: string): boolean {
return [...l1].reduce(toNum, l1) === [...l2].reduce(toNum, l2)
}
June 5, 2020