All the problems I solved on Leetcode. It's just so my GitHub won’t gather dust while I wait to get a computer.
After some time doing Leetcode, I discovered that most people (especially beginners) face the same issue. Not a lack of skill, but a lack of understanding. They often misinterpret the exercise and get stuck for hours, then complain in the comments about how Leetcode’s problems are poorly written and flawed.
Sometimes, once you clearly understand a problem, the solution feels natural.
I often feel like most people don’t understand the purpose of Leetcode’s problems. As Paul Zeitz stated in The Art and Craft of Problem Solving, there is a difference between a problem and an exercise.
An exercise is a straightforward task where you just apply what you already know (for example, writing the Fibonacci series algorithm). You just need to recall knowledge to solve it.
A problem, on the other hand, requires you to think about how to solve it first. You need to understand what’s being asked, gather the necessary tools, and figure out relevant approaches. A problem is not supposed to be clear about what you have to do and how to do it, that’s the role of an exercise.
Don’t confuse the two, otherwise you’ll keep complaining about how Leetcode’s problems are poorly stated instead of learning to think like a problem solver.
-
Carefully read the exercise: This is the most important part. A single misinterpretation can send you straight into a trap. It’s better to restate and fully understand the problem before going further.
-
List the necessary tools: Once the problem is understood, you need the tools to solve it. Look at how each part of the problem matches a known pattern.
-
Use analogies: Instead of solving every problem from scratch, it’s often better to look for similarities with problems you’ve already solved. This way, you can reuse solutions and go faster.
-
Check the solution: If all else fails, I look at the solution. That way I absorb the pattern behind the problem and make sure that if I see a similar one again, I’ll be able to solve it, especially since it adds a new analogy to my toolbox.
People on Leetcode often misunderstand something: difficulty is relative. Maybe someone gets discouraged after spending hours on a problem, while another person shows up and says, “That’s so easy, it doesn’t even deserve to be on Leetcode.”
The truth is, Leetcode problems often rely on specific patterns. The more exposure you have to a given pattern, the easier the problem feels. If a problem seems hard, it’s usually just because you’re discovering a new pattern, not because you lack intelligence.
That’s why it’s important to follow your own pace, learning and practicing patterns one at a time, instead of constantly comparing yourself to others.