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.
But in O notation it will be 3x vs x² i think this is still better than having nested maps or foreach.
This solution only fits on a single line but forces the array to be traversed twice.
This comment is hidden because it contains spoiler information about the solution
I found the solution, but my string is not really CSV lines with expected separator '\n'
In PHP I have this result :
Expected: '0,1,2,3,45\n10,11,12,13,14\n20,21,22,23,24\n30,31,32,33,34'
Actual : '0,1,2,3,45\n
10,11,12,13,14\n
20,21,22,23,24\n
30,31,32,33,34'
I just put '\n' in the end of line. But it's seems to bee not good
I don't understand.
I'm on PHP. In basic tests, when n strings = 6 and k = 6, my function returns '' and it is correct.
But in random tests, when n strings = 14 and k = 14, my function returns '' and it is asked for a string consisting of all the strings.
Idem for me (on PHP)
This comment is hidden because it contains spoiler information about the solution
I was tempted to use the array_map(), max() and min() functions but with this solution each array is scanned 3 times. Which doesn't pose a problem, we're fine with small arrays.
I guess it's clearer with pictures :)
Fixed.
I think the issue is fixed, could you please verify?
It seems to be a bug, I'm not sure yet if it's a bug in the kata, or in setup of PHP on Codewars.
This comment is hidden because it contains spoiler information about the solution
Thank you for your reply. And sorry for not specifying what language I'm using. :)
Loading more items...