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.
@expyth it's not the fastest but it's easy to read. Take a look at @rowcased's comment above where he provides benchmarks.
I don't get how this solution is the fastest.
It has 2 for loops.
Can someone explain?
I'm the same way. Says I can't pass 3 tests but can't fiture out why I can't pass them
Thank you.
Part 3... any idea would be welcome, but what's left?
and thanks. that was my initial thought. part 2?
Thank you!
Happy to help :)
It's Python :)
I still don't know what programming language it is, but I guess @AcesOfGlory does and has correctly identified the issue.
In short, a string and a list of numbers don't behave the same. You'll have to first figure out how to convert it.
PS: A list of strings will also not work.
It's because the first item (zeroth index) of the string is "-" and because you are doing
numbers[0]
, it will only pick up the negative sign and not the number. This will also not work for numbers with more than one digit.Since you're spliting by whitespace, you should declare the variable after the split function so that it takes the whole number and not just the first character.