From a "code golf" perspective, this indeed is a good solution. Anyway, though I like codewars very much, I find it frustrating how top-voted solutions are always the shorter solution. I rarely see on top readable solutions or optimized solutions. But those two points should be far more critical for a professional coder than the length of the code.
Indeed!
Same problem here! If I run the same test elsewhere, it returns the correct output...
From a "code golf" perspective, this indeed is a good solution. Anyway, though I like codewars very much, I find it frustrating how top-voted solutions are always the shorter solution. I rarely see on top readable solutions or optimized solutions. But those two points should be far more critical for a professional coder than the length of the code.