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.
OCaml translation (author gone)
Haskell translation
approved
looks like it was rejected
This comment is hidden because it contains spoiler information about the solution
Good, that codewars is not a platform to write productive code on :-)
The solutions under here aren't being pushed into a company's repository. Sometimes, best practices advice like this is unsolicited
This challenge has literally "golf" in the title, and is tagged with
restricted
tag. So yes, you need to come up with short code, this challenge is designed this way.Do we really need to shorten the code to such an extent—to just 9 characters?
The main purpose of programming is not just to run code, but to write it in a way that is clear, understandable, and maintainable. Excessive code golfing solely to meet an arbitrary length limit goes against best practices in clean coding.
This type of challenge, known as Code Golf, can be a fun mental exercise and experiment, but it is not practical at all in the daily work of programmers. Companies and development teams prefer clear, well-documented code over short, obscure code.
Encouraging clean and readable code writing is much more valuable for learning and skill development than forcing extreme code shortening that harms clarity.