forked from M3-Academy/challenge-algorithms-v2.0
Merge pull request 'feat: solucao isAnagram' (#8) from feature/solucao-isAnagram into development
Reviewed-on: #8
This commit is contained in:
commit
5cc3db4d56
@ -1,4 +1,11 @@
|
|||||||
export function isAnagram(word1, word2) {
|
export function isAnagram(word1, word2) {
|
||||||
// implementar logica aqui
|
// 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;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user