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.
It works like built-in
split()
. Hint: message you're writing about isExpected an error when empty delimiter!
, that means that there is delimeter, but just empty..na, you have to throw an error/exception if you don't get a delimiter.
Tho, that is when the delimiter is actually empty. when it's "somehting else", you have to do... something else... :/
I'm a bit confused by the "No delimeter should throw an error" test. Even some dummy test code using the
.split()
function doesn't throw an error in python 3.6 (see below). Usingraise ValueError
just stops the whole thread.You can do a simple test: execute a single for loop on the lists and watch your code time out.
If you do a print call on ints you can see the output of the final tests are in excess of 10mB. Solution needs to use O(n) time.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I have to disagree: given that the error returned is "[9, 10, 0] should equal [1, 0, 0, 0]" It seems fairly clear that the input is [9,10,0], which appears to be invalid per the rule "Input must be a single digit, non-negative int"