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.
in this kata the needle is a string constant,
"needle"
. this is why the function only takes one parameter, the array in which to search.added a test to invalidate those solutions
done (
new String("needle")
is enough to create a distinct object)done
fixed
I don't understand what the problem is. The function accepts array called
haystack
, isnt this clear enough?This comment is hidden because it contains spoiler information about the solution
I managed to submit. I confused the expected result with the result returned by my solution.
Amount of information in this bug report makes it impossible to even start fixing the issue. Closing as per insufficient details.
some test are not matching with the function description make it impossible to submit even the solution passing all the other test Cases
PHP
fork, for fixing this, and (probably) this issues.In short, you returned the wrong data structure.
Some languages (like Python) have a builtin function that finds the needle for you, and even in other languages you can rather easily iterate through the array to find the needle' position.
I keep getting this error Basic Test Cases
('found the needle at position', 3) should equal 'found the needle at position 3'
('found the needle at position', 5) should equal 'found the needle at position 5'
('found the needle at position', 30) should equal 'found the needle at position 30'
no where in my code is it supposed to return the "," and adding the varible with a + just causes errors
can you provide the code
Loading more items...