Over the past few weeks, I’ve been active on solving problems on Leetcode. This all started when I signed up for the April LeetCoding Challenge. Over the course of this time, I’ve have learned a lot and wanted to share some of them you.
Solving easy questions first. This helped me keep coming back and trying to do more problems. It got me in a grove and just put me in a state where I wanted to solve problems frequently.
Create a todo of questions and continually update. I realized after solving a question, Leetcode will suggest other questions to try. Sometimes, time is not on my side so I add them to a list of todo problems and revisit within days.
Don’t get hang up on a questions for too long. I once picked a hard question (Serialize and Deserialize Binary Tree) and spent a whole weekend on it. This was not a very use of time. The truth is that there are others that are smarter, more experienced or can come up with faster algorithms. If you spend about an hour on a problem, then look at the hint(s) or solution and keep moving forward.
Don’t implement solution you had to look until after 24 hours. This has helped me not just memorize a solution but rather make sure I understood the logic behind the solution. If I had to look at a solution, I say it out loud in front of a mirror like I’m explaining it to someone. I then come back to code it within 24-48hrs to solidify my understanding.
When your solution works, post it and explain the logic. We are here to learn and be part of a learning culture. The most rewarding thing I’ve had from Leetcode is when someone comments on solution that I have posted and that it help them.
After pasting a solution, look through how others solved it. I’ve learned other insights like how others approached the same problem. Sometimes it has given me clues to make my algorithm better.
Solve more challenging (medium & harder) problems. This has helped me improve my skill set everyday.
Take time appreciate others. When a solution is quiet elegant or just brilliant, I acknowledge through an upvote or comment. This has helped me to strive to create better algorithms so I can proudly share.
Don’t be salty. I admit there was one time I posted my code that a “bug”. The problem did not have enough test cases to catch this bug. Someone pointed this out. Although this individual this so in a “jack-ass” fashion, I was salty for a bit. This is never good. Always maintain positive vibes
Continue to share knowledge. Post new questions, interview experience and articles such as this one.