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.
can I strike my answer from ever having existed? is what I thought when I saw this
Wait what?
yes, because in your sum(ord(c) for c in s) you traverse list two times, first "ord(c) for c in s" and second sum().
the best solution is when you do it for the on traverse.
молодец
so clever
C sample test code has compilation warnings.
It's not faster, if you run the code, you'll notice that the time varies a lot between one and the other, sometimes one is faster and sometimes the other, and endswith is written in C for performance.
Thank you. I have enjoyed solving this kata.
nice
laughed at first, but taking a second glance my jaw dropped
I don't think this Kata makes sense for C. As far as I can tell, the input parameter should allow any possible type rather than limiting it to just
char
s. The simplest solution would hence require dealing with void pointers through which type information is lost and you'd have to expect the caller to also pass in a stringifying function. Faithfully implementing this Kata in C would just be too awkward for 8kyu imo.Yeah thanks, thats the problem. i forget to sort it. All good now.
But it is not correct? The example shows that expected answer is not
[3, 2, 1, 7, 9, 8, 6, 4, 5]
, but something else?There is this example in description:
What does your solution return locally for the above input?
Hello,
for example i took the example: new int[][]{{3, 2, 1}, {7, 9, 8}, {6, 4, 5}}. using java the answer from my local is [3, 2, 1, 7, 9, 8, 6, 4, 5]. it seems correct, but pasting the source code and run on codewars it return error.
Codewars is the machine
Loading more items...