I miss simple things when solving LC questions
Feb 12
4 Comments
When solving LC questions I consistently miss very simple things that get me stuck. They tend to be attributes that are innate to this problem or data set, that once realized make the answer almost second nature. I get so tunnel vision with the first crappy idea that pops in my head and it becomes so hard for me to look at these problems at a high level and conceptualize an answer.
What am I missing?! Please share any tips.
#leetcode
#interview
#swe
comments
It’s not magic you’re just not focusing on finding a solution to the problem. They’re mostly straight forward applications of recurring patterns. It seems you think they all have gotchas
Find the recurring patterns by solving concrete examples. Understand why they work well together (incrementing/decrementing 2 pointers in a sorted list) and then realize the subset of problems that can be solved with the pattern in some way.
Most problems outside of DP don’t have “gotchas” they just have patterns you’re not familiar with so you think they’re “gotchas”