I think there is actually a test case where it has whitespace in the end and it works without .trim()
I forgot you can split them. I think I'm too used to regex lol
If I log out the input array after the method has run, I get the same as before, i.e. the input is not changed.
Because this has a complexity of O(n²) which is awful
Sometimes the shortest decisions in codewars have an issues. But pass all the test cases so they are winners by the way...
Bad way to solve the problem
this has the complexity of O(n^2)
Oh, shit!, I had no idea for the second argument in the int function. The use of the map is perfect.
wrongo, you didn't read the question correctly
Yes! Exactly what I was about to point out :)
The first pair of parentheses is the function call (startswith()), the second is the (tuple) containing individual prefix strings.
startswith can be called with a tuple of prefixed and will match any one of them.
I'm just wondering why we have double brackets around the numbers?
This comment is hidden because it contains spoiler information about the solution