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.
youre close to your given runtime but using arr1.sort() and arr2.sort() at the start ruins it - try arr1.reverse() and arr2.reverse() instead
This entirely defeats the point of the problem, that being to take advantage of the fact that the arrays are already sorted.
This comment is hidden because it contains spoiler information about the solution
same
HATE RETURN
nice radix conversion from int to string
counting matches of '1' is simple, and could easily scale to higher radixes such as octal
could easily be extended to match multiple digits, such as .count('137')
range traversal is clear
accumulator function sum() over a list is also a nice aggregate function
range(1,7)
the last number (stop=7) is not included in the range function so when you write 7 the iteration of the for loop will stop in the number 6 (since the 7 is not included)
so when you want to stop in 7 you should do 7+1
oh yeah range does do these things don't it
Oooooh, I just got it! Brilliant!
the same way i solved problem. which is faster? replace or repeat?
Oh, I totally forgot that range can do this.
dropped it into C++ ;)
This comment is hidden because it contains spoiler information about the solution
damn forget about that one
i had the same idea, just used a string instead :(
Loading more items...