- #1
shivajikobardan
- 674
- 54
- TL;DR Summary
- codewars kata not passing all tests.
https://www.codewars.com/kata/54ba84be607a92aa900000f1/train/javascript
This is my code for it.
My code isn't passing all tests, why? I feel this works fine.
This is my code for it.
JavaScript:
function isIsogram(str) {
let i, j;
let str1 = str.toLowerCase();
for (i = 0; i < str1.length; i++) {
for (j = i + 1; j < str1.length; j++) {
if (str1[i] === str1[j]) {
return false;
}
else {
return true;
}
}
}
}
isIsogram("Dermatoglyphics");
My code isn't passing all tests, why? I feel this works fine.
Last edited: