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.
This comment is hidden because it contains spoiler information about the solution
This is definitely a clever answer.
This comment is hidden because it contains spoiler information about the solution
Because of
for chunk in range(0, len(chunks)):
, eachchunk
is an integer.for digit in chunk:
is you trying to for-loop over that integer, which makes no sense. I think you wantfor chunk in chunks:
.You can just write both
f str = ...
andsc = ...
in the samewhere
clause.This comment is hidden because it contains spoiler information about the solution
If your range is large enough, this recursion exceeds maximum call stack.
I think this is O(n^2), so it's not very efficient for longer strings.
Note that the
|>
operator comes fromFlow
package, and is used the same way in Elm and F#. I find it much cleaner and easier to read, especially since you can read it left-to-right instead of right to left as with(.)
.This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
How the heck does this work?
This is probably the most efficient, no?
This comment is hidden because it contains spoiler information about the solution
Loading more items...