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.
The function base itself
f=s=>
is 5 characters. So you only have 4 characters to check if a variable is uppercase or lowercase.The best I can come up with is 5 characters... just one short.
I need a hint :( and yea this is rated 7 kyu for some reason
You could do that, and then also add random tests on top.
same, and i think we have the exact same code
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.
this has been removed from the description
done
done
this should be marked best practice, there is no absolutely reason to use ternaries like the current top answer
i love how all of us have the same solution except the variety is on characters
(not like there was any other way to solve this god forsaken puzzle)
done
this is an interesting one!
Loading more items...