feature/algoritimos #1

Merged
RamonDiasFerreira merged 11 commits from feature/algoritimos into master 2022-11-02 19:48:31 +00:00
Showing only changes of commit 712c72d45c - Show all commits

View File

@ -1,4 +1,13 @@
export function isAnagram(word1, word2) {
// implementar logica aqui
}
let word1Lower = word1.toLowerCase()
let word2Lower = word2.toLowerCase()
if (word1Lower.length !== word2Lower.length) {
return false;
}
var string1 = word1Lower.split('').sort().join('');
var string2 = word2Lower.split('').sort().join('');
var result = (string1 === string2);
return result;
}