We started this community with the goal of making it the best place to learn competitive programming. Hint by hint solutions play a big role in that.
As more and more people start writing hints, I thought it would be helpful if I penned down some of my thoughts on writing high quality hints.
- The most important thing is the difference between a solution vs the dissection process. A dissection process captures your thoughts, and how you broke down the problem. Don't just say, "use heaps". Say the observation about the data, and hence heaps is a good data structure to use. Don't say, "use dynamic programming". Say why first.
- Spend time figuring out if your solution is the simplest possible. When solving a problem, we come up with observations that we don't end up using in the solution. Writing (and worse, coding!) that makes things confusing for everyone (and you, while debugging!).
- Use small examples. Algebra is tougher to read and write, and its easy to make typos. Also, you usually use examples to solve the problem. Write those down.
- When I find it difficult to write a particular hint, its often because I'm trying to cram too many things in one hint. Again, thats tough to write and tough to read. One step at a time works best.
- Remember who you are writing for. If its a really tough problem with 3 sub-problems, then you're not writing for beginners. So its okay to skip explaining the details of how to solve the sub-problems.
More tips coming soon... I'll keep updating this list as I read more hints and see patterns of similar mistakes.