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.
Why would it be slower? Not that performance matters when you are doing code golf.
You can omit the
;
and replace&&
with&
to shave a few bytesThe
result
variable in line 2 is a "suprise global". Just so you knowI think this is just missing a few newlines to be perfectly readable production-quality code.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Haskell translation addded. https://www.codewars.com/kumite/5eafa013e24b830032704262?sel=5eafa013e24b830032704262
If you are going to reverse it wouldn't it be better to use tail which is more efficient?
Or equivalently,
Of course
reverse . tail . reverse
is just a less efficient (and stricter)init
I just realized that it would be better to use an std::array of int instead of char. The generated assembly also looks a bit nicer.
charGroups
is the same asgroup'
fromData.List
TIL: Haskell has a special case so that
(- 1)
is not a section equivalent to\x -> x - 1
, it is actually equivalent tonegate 1
This comment is hidden because it contains spoiler information about the solution
You forgot to use
divBy 2
instead offlip (//) 2
The boobs operator!
Loading more items...