Merge branch 'feature/isAnagram'

This commit is contained in:
Marcela Mathias 2022-11-02 19:34:48 -03:00
commit 07f5b2dd39

View File

@ -1,4 +1,10 @@
export function isAnagram(word1, word2) { export function isAnagram(word1, word2) {
// implementar logica aqui const normalize = (str) =>
str
.toLowerCase()
.replace(/[^a-z0-9]/gi, "")
.split("")
.sort()
.join("");
return normalize(word1) === normalize(word2);
} }