Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
What do you mean by "Symbols in uppercase"?
Why dont you add symbols in uppercase?
Oh of course! Thanks.
indexOf returns the first occurence of a number, your code won't work if the numbers are not unique.
Why are you using indexOf at all? You already have the index in a var.
This comment is hidden because it contains spoiler information about the solution
You're right, thanks for clarifying it.
Try writing in english (the common language in CodeWars). What happens if the array is empty in your code?
This comment is hidden because it contains spoiler information about the solution
Hola, no entiendo por que no me pasa los test ramdom y edge. Los sample los pasa ok
Lo he hecho en eclipse y lo he probado con varios casos y devuelve el valor correcto...
lo que se pide es que si el array contiene todos los numeros entre 0 y length-1 devuelva true
alguien que me diga donde esta el error?
public class Solution {
}
Why doing 100 random tests with a set of only 24 different inputs?
Add a fixed edge test case like the one @javisp91 mentioned below:
[0, 0, 2, 3]
If your function returns true in that case, your code is not ok. That it passes the tests means the tests aren't hard enough and more tests (possible edge cases like you mentioned) should be added to prevent faulty solutions pass.
This comment is hidden because it contains spoiler information about the solution
I don't understand your comment, the 1 is missing there. So by definition that's not an array of all possibilities. There are a lot of arrays that are not an AoAP (arrays with repeated values is a subset of those).
Hello! I'd just like to say it wouldn't work if there were a duplicate in the array:
isPossibilities([0, 0, 2, 3]);
You'd get 0 as the minimum number, and then 3 would be equal to the arr.length - 1.
Loading more items...