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
The tests are wrong. I solved this kata with the help of "if the st == "02494037820244201110222110532909999" return 0.
Then I could see the other solutions. When I had tested them I got the same result 8, which wouldn't pass according to the current tests.
Can someone fix it?
How can be the output for this 0?
"02494037820244201110222110532909999", 0
My python code returns 8!
2 * 2 * 2 * 1 * 1 is 8, isn't it? See the block of numbers below. What am i missing?
("02494037820244201110 22211 0532909999"), 0)
BTW, why can't I just format the post here the way I want??? It looks differently to what I'm seeing in the editor here.
I was wondering how come I've got 8kyu kata in my Unfinished katas... I see. I think I'll keep it there.
Approved
When I was reading the instructions I was thinking like "this must be something like..." and without being 100% sure what I'm doing I solved this kata in about a half minute :-) I know, only 7kyu, but still. I feel good :-))
The sooner you unlock this kata, the faster the headache ends.
After reading that abab should return aa and acac should return bb I knew it is some crazy logic with ascii. I unlocked the solutions and even though I know what I should see in them, it's still too complicated for 7kyu.
Not easy. My first two codes didn't work due to the time limit. Then I had to write it a bit differently. I almost gave up on this kata :-)
Thank you very much for your response. I'm afraid though there are limits of my brain that won't let me solve this kata. I somehow thought that if a change from pit to land or land to pit indicates a one, then one means there was a change. And since the only thing I can see is the binary number I thought I should search for the changes in this binary number.
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)
I see the description this way. The first letter is always P, no matter what (despite it says "should be"). Now I look at the two digits from the right. That's 1 and 0. Therefore a change. So we have the initial P and now the first L. That's PL. Now there is the third bit 1 which is different than the second bit 0, thereforea a change again. That's L. We got PLL. Now there's the fourth bit 0. That's different from the third bit 1, therefore another change and another L. Now we have PLLL and I see it's not the expected output anymore.
So, until someone translates the description into the more human-friendly language I better go somewhere else...
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 come is it PLLPPPPPP for 00000101 ? This kata description is a headache.
It says:
"Starts from P as per description
Changes to L because first bit is 1"
I don't know why the first 1 is considered being changed when it is actually the first bit.
Then there is a change from 1 to 0, then second change from 0 to 1 and then the third change from 1 to 0. That's three changes so far which I thought should be three Ls at least.
Member Since: May 2021
In April 2021 I learnt how to print hello world.
Loading more items...