Solutions to HackerRank problems
A bunch of solutions to problems on HackerRank.
Feel free to suggest improvements for the code and documentation ...
If you're working through these yourself, please try to solve them on your own first. If you are completely stuck, then the “discussion” tab on the problem page can often yield useful hints. It's also often worth searching t'Internet for key words relating to the problem description (but try to describe the problem, not the situation set up in the description :o)).
If you do end up virtually copy-pasting the code for an algorithm, try to figure out how it works.
It's not that I consider it “cheating”, more that
- my solutions are sometimes far from the best possible¹
- you’ll generally learn more if you give it a shot
You need to learn when (or not) to apply an algorithm.
¹ I've found at least one bug while skimming through these that by rights ought to have meant a failed submission.