The Difference Between Knowing an Algorithm and Solving a Problem
We've all been there.
You read a problem, recognize the algorithm, and think, "This is easy." Then you start coding, and suddenly things get complicated.
Maybe the edge cases don't work. Maybe your idea was wrong. Or maybe you knew the algorithm, but couldn't figure out how to apply it.
Knowing isn't the same as understanding
Knowing binary search, DP, greedy, or graph algorithms is only one part of competitive programming.
The real skill is knowing when, why, and how to use them.
A problem rarely tells you directly which algorithm to use. Instead, it gives you constraints, observations, and clues. Your job is to connect them.
Think before you code
Before writing a single line of code, try asking yourself:
- What exactly is the problem asking?
- Can I simplify the problem?
- What do the constraints tell me?
- Is there a pattern?
- Can I prove that my idea works?
Sometimes spending five minutes thinking saves thirty minutes debugging.
Wrong answers aren't wasted time
A failed submission doesn't necessarily mean you're bad at programming. Sometimes, it means you overlooked something, made an incorrect assumption, or haven't found the right perspective yet.
Every problem you struggle with can teach you something — as long as you actually analyze why your approach failed.
Don't just read the editorial and move on. Try to understand the idea deeply enough that you could explain it to someone else.
Final thoughts
Competitive programming isn't just about memorizing algorithms or collecting accepted submissions.
It's about developing the ability to think, experiment, prove, and improve.
And sometimes, the most valuable thing you gain from a problem isn't the AC — it's the idea you didn't know yesterday.
Keep thinking. Keep solving. Keep improving.



