feature-algorithms #1

Merged
JoseGregorioMataRodriguez merged 10 commits from feature-algorithms into master 2022-10-29 04:37:09 +00:00
Showing only changes of commit b6ab1f4f3a - Show all commits

View File

@ -1,4 +1,22 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
if (word1 != word2){
if (word1.lenght == word2.lenght){
word1 = word1.toLowerCase();
word2 = word2.toLowerCase();
let teste = word1.split('');
let origin = word2.split('');
teste = teste.sort();
origin = origin.sort();
teste = teste.join();
origin = origin.join();
if (teste == origin)
return true;
else
return false;
}
else return false;
}
else return false;
}