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.
Memoization / look-up approach is required. The expected time complexity is O(1).
OP solved it, closing
This comment is hidden because it contains spoiler information about the solution
ROFL you got a bug, you need to find a solution which works for given numbers LMAO.
The input range should be specified tho, so users know what data types to use.
Your code returns 4000 for that input. Not a kata issue. The error message could be clearer, tho. I've changed the sample tests so you can see what your function returned. Backup your code, click Reset to update the tests, paste your code and try again.
The reference is the same even if you use a new variable.
This comment is hidden because it contains spoiler information about the solution
The reason why your code fails apparently only on one test is because tests are very weak. This code should fail on several cases. It is clear according to the description that this is not a valid ticket, isn't it? You should try to print how you actually split the string...
Because result is another reference to the same list.