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.
I did similar. To speed it up, you can move the [char == " ":] section inside the [if i == True:] section. This will cut the number of compares to almost half. Why does this work? There's no need to set i to True after you already have.
The fun here is in finding out the algorithm for yourself. You shouldn't be a programmer if your first instinct is to google the algorithm.
That was actually my first thought when making my answer to this kata. Until halfway through I realized that I wasn't accounting for duplicates which happened to add up to 45 in the end.
User is not active anymore.
indx = arr.index(val)
this will not work if there're duplicates in array.This comment is hidden because it contains spoiler information about the solution
You can google pretty much any problem, the thing is working it out yourself.
This comment is hidden because it contains spoiler information about the solution