feat: solucao isAnagram

This commit is contained in:
Rafael Sampaio de Oliveira 2022-10-28 10:55:14 -03:00
parent c6f6df9c59
commit 2c23f938b6

View File

@ -1,4 +1,11 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
let str1 = word1.toLowerCase().split("").sort().join("");
let str2 = word2.toLowerCase().split("").sort().join("");
if (str1 === str2) {
return true;
} else {
return false;
}
}