Eda Eren

February 13, 2024
  • Miscellaneous

LeetCode Meditations: Introduction

Cover image

It may seem like an oxymoron when the words "LeetCode" and "meditation" are used together; after all, one thing that almost everyone can agree is that LeetCode is challenging. It's called grinding LeetCode for a reason.

It doesn't have anything to do with the platform, of course, but rather what it represents: tackling problems for hours on end, usually to find a solution that is even harder to understand.

However, what is more challenging is finding a roadmap to solve those problems with very little knowledge of data structures and algorithms. There are prerequisites to solve one type of problem, and there are prerequisites for understanding those prerequisites in the first place. It's just intimidating when you consider yourself a beginner.

That's why finding out about this roadmap from neetcode.io gave me an idea. LeetCode can be a good resource as you go about learning the concepts. In fact, why not take a more structured and calmer approach? If you don't have an interest in competitive programming or things of that sort, it doesn't have to be a pain. We can treat learning about the topics and solving the problems on the list like taking a brief walk in nature, and maybe even pay attention to our breathing as much as we pay attention to the runtime analyses. Also, an important point: it's not necessary to spend way too much time trying to solve one problem in one sitting; it is not only unhealthy, but it won't provide any value after some point.

The NeetCode roadmap contains a lot of problems, but in this series, I intend to follow the Blind 75 list as the roadmap also includes it. I aim to "get-to-know" (or at least, introduce myself to if I'm unfamiliar with) the "prerequisite" topics before each section, and for the problems, try my attempt at a solution one at a time, and when I get stuck, I'll at least try to reason about an idea of a solution. And, if I get really stuck and can't come up with an idea as well, then it's time to take a breath and learn about the solution(s) available.

In fact, if you've read this far, why not take a deep breath now, too?


The premium problems won't be included, as I want this series to be accessible. I'll provide NeetCode's solutions here and there for comparison at the end as well.

Now, time for some introspection. Is it likely that five years or so later I may regret putting up my first attempts for solutions to those problems? Probably. Will I be satisfied that writing about them is an aid to my learning, and shows an aspect of it? Yes, I guess. Will I be satisfied that there is a chance this series might help someone out there? Absolutely.

Solving hundreds of LeetCode problems may be the gate to go through to get an interview at big tech companies, but learning the topics the problems are about is not under anyone's monopoly.

With that said, let's start the first chapter.