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.
As I understand this solution, it will allocate memory for characters after the anchor '#', so we can use less memory here.
~150 unnecessary symbols, meh (check kumite fork).
but very interesting VecDeque and format order way, great!
Breaks aren't necessary here since the function ends when return is called.
I almost got this soultion but I had sheep[i] on the wrong side.
There may be an edge case that won't pass the test
beautiful. :)
it's very legible (the most), but repeating. voted like clever.
There is a memory leak, the
buffer
is not freed. It is missing thefree(buffer);
before thereturn
.What about these magic numbers 15 and 20?
I am not an experienced C programmer, but I think it limits the input to a number with 15 digits? I think this should be implemented more generic to be "Best Practice". It is not a big deal to get the number of digits of an int.
Am i wrong?
I have the impression that this solution is wrong... Consider "1110000000111" (3x1, 7x0, 3x1). The shortest sequence of zeros or ones is of length 3, and yet the time unit is 1. You should take the gcd instead of the min.
THANK YOU for comments
Loved this! Nice job!
This comment is hidden because it contains spoiler information about the solution
I'm actually impressed at how bad my code is compared to this solution, lol
While this solution is simple and looks nice, it is not portable because of a byte order problem.
On a machine with big-endian byte order, this formats the IP the wrong way around.
It's a shame, much software out there is not really portable because of little assumptions like that.
Loading more items...