feature/algoritmos #1

Merged
WellingtonDuarteSantos merged 10 commits from feature/algoritmos into master 2022-11-01 12:40:20 +00:00
Showing only changes of commit 0efd909b9c - Show all commits

View File

@ -1,4 +1,22 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
let test = word1.toUpperCase();
let original = word2.toUpperCase();
let tamanho1 = original.length;
let tamanho2 = test.length;
if(tamanho1 !== tamanho2){
return false;
}
let str1 = original.split('').sort().join('');
let str2 = test.split('').sort().join('');
if(str1 === str2){
return true;
}
else{
return false;
}
}