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.
definitely harder than 8 kyu
This comment is hidden because it contains spoiler information about the solution
But the descripition doesn't say to do what you are doing anywhere. Nowhere in the description does it say to compare two different bits, as you are doing, you do not need to compare two different bits. In other words, you do not need knowledge of the previous or next bit in order to encode the next pit/land.
Again the key is "a change from pit to land or land to pit indicates a one, while no change indicates a zero"
So bit 1 = L (if the previous indent was P) or P (if the previous indent was L) and bit 0 = L (if the previous indent was L) or P (if the previous indent was P)
As per the description: "a change from pit to land or land to pit indicates a one, while no change indicates a zero"
So in the example, "PL" encodes 1, "LL" encodes 0, "LP" encodes 1. "PP" encodes 0.
how long did it take you to get to 4th Kyu?
Rather than searching for how to make naïve approaches faster, try thinking about mathematical properties that can be inferred when you only need the last digit.
Just tried numba at home:
I doubt you can find any library able to compute efficiently, for example,
11589622874141843207737526893160045027229209055888190994639 ** 10185873300040714483538003999669899935043458641404648017101
.I had this problem when my solution relied on modifying the function parameters (even though other test cases were fine). The solution was to not do this!
Try reading up on "side effect".
This comment is hidden because it contains spoiler information about the solution
you were right to point it out, it has now been fixed ^w^
Hm, ok, I saw the corrected version so I misunderstood elevenpix' message.
no he is right, the bracket was incorrect in the cipher example. i fixed it (sorry about the merge conflict, but it was already there anyway because my Python fork got approved)
This is a generic definition of the task, independently from any particular language syntax.
Loading more items...