How does this have anything to do with math?
perfect example of implemention of math skills
Java: Exactly one random test and no test expecting null.
null
I feel silly now
approved
C Translation (author inactive).
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/71 Please join the discussion to share your opinions, and help us identify duplicate kata and retire them.
I've revised the description, I hope it's clearer now. Thanks!
Fixed, thanks!
doh! I hate when I leave the redundant bits
No tests with all arrays being full of zeros.
Such input is sometimes generated randomly, but the reference solution is wrong, and it fails in such cases.
One random test is not enough.
The tests are showing warnings.
??? Expected: 'fi', instead got: 'i' !!! only this problem ##CODE## function firstNonRepeatingLetter(s) { let arr = [...s.toUpperCase()].find(i => s.toUpperCase().indexOf(i) == s.toUpperCase().lastIndexOf(i)) || [] if(arr.length==0){ return ''} else{ return s.indexOf(arr[0])>-1?arr[0]:arr[0].toLowerCase(); } }
Thanks a lot! Fixed.
Loading collection data...
How does this have anything to do with math?
perfect example of implemention of math skills
Java: Exactly one random test and no test expecting
null
.I feel silly now
approved
C Translation (author inactive).
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/71
Please join the discussion to share your opinions, and help us identify duplicate kata and retire them.
I've revised the description, I hope it's clearer now. Thanks!
Fixed, thanks!
doh! I hate when I leave the redundant bits
No tests with all arrays being full of zeros.
Such input is sometimes generated randomly, but the reference solution is wrong, and it fails in such cases.
One random test is not enough.
The tests are showing warnings.
??? Expected: 'fi', instead got: 'i'
!!! only this problem
##CODE##
function firstNonRepeatingLetter(s) {
let arr = [...s.toUpperCase()].find(i => s.toUpperCase().indexOf(i) == s.toUpperCase().lastIndexOf(i)) || []
if(arr.length==0){
return ''}
else{
return s.indexOf(arr[0])>-1?arr[0]:arr[0].toLowerCase();
}
}
Thanks a lot! Fixed.
Loading more items...