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.
I have added some comments and example code in the initial solution, hopefully it will be easier to understand what is required
Only God knows. Setup and allocation requirements of many old C kata are true mystery.
No, seriously now: what your solution has to return is a dynamically allocated array of pointers to
Pair
, where each pointer points to an individually, dynamically allocatedPair
. Don't ask me why, but there's more kata with such setup.Maybe just try it in another language.
Hi! Did you complete it? I'm stuck with the same problem I can see in other comments: getting 1064 instead of 1074 using JS.
Edit : OK, it seems my question was dumb. I'll keep thinking for an other way and checking my code.
Yes :/ the problem is this kata lacked clear specifications so translators to new languages did their own ways...
You're right, random tests can generate several consecutive spaces. trashy_incel changed the description yesterday, he seems to have been mistaken.
The description means between two words there is only one space.
Maybe you should post your code with a spoiler flag so someone can control what's happening. I checked the tests and they seem ok, but I didn't solve the kata so I can't tell much.
fixed, sorry for that
What language?
Just fixed that.
There's an error in tests logs (it should display the inverse). But the test itself is correct: the correct answer is
false
and you're returningtrue
. I missed that when approving the translation. I'll leave a message to the translator for him to fix it.I don't think it's too large. It's a performance kata afterall.
Thanks! Maybe the number of random tests is too large? But on the other hand, it can be solved just with basic arithmetic operations.
The good ones are the ones we solve ;)
Check the description again for the case with
3
, for example.