365 Days of LeetCode


I solved LeetCode’s daily problem every day for 365 days straight.

Why?

I did this challenge to improve my problem-solving skills, and because I just enjoy solving programming problems.

One of my life goals is to become a professor of Computer Science at an accredited university. I don’t want to be an average professor though; I would like to be an excellent professor. I’m talking about the kind of professor that ignites in their students a passion for learning, and makes the road to success clear. In order to explain my subject well, I feel I need a strong understanding of it. Furthermore, having strong problem-solving skills will also help me solve research problems, which professors also spend a great deal of time doing (or at least trying to do). So by becoming an excellent programmer, I am one step closer to becoming an excellent Computer Science professor.

The second reason I did this challenge is just for the fun of it. I enjoy activities of the mind (e.g. reading, chess, and card games), and to me programming problems are some of the most challenging mental activities. I’ve been a little obsessed with them ever since undergrad, when I first realized there was so much more to Computer Science than just writing code. Every time I solve a problem, I get a little rush of serotonin, and a feeling that I am just ever so slightly smarter than I used to be.

How did it go?

While I would like to say that I solved every problem on entirely my own, I will admit that some of the medium and many of the harder problems stumped me, and I had to refer to other existing solutions for help. I still tried my best to solve every problem though, and would often invest an hour on a problem before giving up and looking at another solution. On the bright side, reading other peoples’ solutions introduced me to new problem-solving techniques and approaches that I doubt I would have found if I were to only solve problems by myself. Whether I solved a problem on my own or not, I was still learning the concepts behind it, which to me is equally as important as solving it.

Speaking of which, I learned a lot! Over the course of the challenge, I got much better at DP, and towards the end I found myself solving many more hard DP problems on my own than I could when I began my quest. I also realized what my strengths and weaknesses are: I really like graph problems, and really should practice sliding window problems more 😅. Finally, I came to terms with the fact that I won’t be able to intuit every solution on my own, and that it’s sometimes better to ask for help rather than pit myself against an intractable problem for hours on end. I was especially stubborn at the beginning of the challenge, and would occasionally spend more than two hours on a difficult problem before throwing in the towel. In retrospect, a better use of my time would have been to give up after an hour, and spend the following hour trying to obtain a deep understanding of the problem’s solution. Oh well, live and learn.

Conclusion

Solving a LeetCode problem every day for a whole year was difficult, but I prevailed. I didn’t always solve the problem on my own, but I tried my best to learn from each problem whether I solved it by myself or not. By doing this challenge, I not only learned new problem-solving skills, but also learned a bit of humility. If this sounds interesting to you, I encourage you to try a smaller version of this challenge! Maybe solve one problem a day for a month instead of a year, or perhaps try GitHub’s Advent of Code challenge in December.

Oh, and I also redeemed all the LeetCoins I earned by doing this challenge for a free shirt! I’ll wear it with pride 😎