You need to sign in or sign up before continuing.×
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.
My C solution passes all the first 60 tests, after the 61st I get the following message:
*** Error in `/home/codewarrior/solution': free(): invalid next size (fast): 0x00000000023bc960 ***
Is your helper function recursive? Please include your solution so I can see what is happening.
I think this is quite hard for 4 kyu, but it was fun.
The other kata asks for simple recursion (top down) which calculates the same value several times, this one asks for botom-up recursion which can calculate the fibonacci element for a higher n. I think it is trying to teach something very different.
In C, the casting the long long ** act into a (long long (*)[2] ) is changing the values and I have no idea why.
It is not that it can not be solved, I wrote a working solution it is that it would make sense that if the key is in lowercase, then the encoded message would be in lowercase as well.
I agree, the way this requires the programmer to check the input is very complicated.
The tests require the encoding function to return an all uppercase encoded string. However, the decoding function according to the tests must accept a lowercase encoded string and a lowercase key. This is strange.