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.
its not readable, short code != the best code.
I don't think it should print the result. This should be changed.
The only performance tests are fixed, and they can be easily hardcoded allowing non-optimal solutions to pass.
How is this not at top?
Added random tests. Guess work solutions killed.
where is the solution?
I think must be test case like
[-5,-3,-2,-4,-1] equal 3
Approved
Added a few fixed tests that will catch them.
You know, you can always add
if(arr.length < x)
in your printing code ;-)Fixed
Typo in Java Sample test - wrong number params to prefix
assertEquals(PrefixPermutation.prefix(3, new int[]{2, 1, 3, 5, 4}));
Please, add details on the assumptions about the input array such as it containing only positive integers, without repetition, or add some tests.
Also precise input array could be large.
I agree, some solutions return
1
for[2, 2, 2]
...Thank you for the comment. I have considered that.
Loading more items...