forked from M3-Academy/challenge-algorithms-v2.0
fix: optimizacão de isAnagram e maxValue
This commit is contained in:
parent
bfd4a7f93f
commit
10ef9194b8
@ -1,5 +1,7 @@
|
|||||||
export function isAnagram(word1, word2) {
|
export function isAnagram(word1, word2) {
|
||||||
// implementar logica aqui
|
// implementar logica aqui
|
||||||
|
if ((!word1) || (!word2))
|
||||||
|
return false;
|
||||||
if (word1 != word2){
|
if (word1 != word2){
|
||||||
if (word1.lenght == word2.lenght){
|
if (word1.lenght == word2.lenght){
|
||||||
word1 = word1.toLowerCase();
|
word1 = word1.toLowerCase();
|
||||||
@ -15,8 +17,9 @@ export function isAnagram(word1, word2) {
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
else return false;
|
else return false;
|
||||||
}
|
|
||||||
else return false;
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user