Leet post-50

2021.04.18

After a few weeks, I’ve gone through a selection of 50 Leet problems. Some thoughts.

  • It’s enjoyable to go through a concept and work through problems, from easy to hard. It’s a steep learning curve going from understanding the basic principle of a concept, to bolting on additional data structure in support of the concept, and in the case of hard problems, having to keep track of additional variables.
  • Remembering how to solve easy to medium problems after the first time is about 50/50. What I can solve one time, seems to stay solvable the second time around. What I had trouble with the first time, stays problematic, which leads me to suspect that there’s issues that I’m still murky about in the problem.
  • I’m still struggling to keep track of the pointers (since sliding window and two-pointers require the movement of multiple pointers) at times, resulting in unexpected answers. I have come to rely on the debugging tool to walk through the loops to find the error. Often times, it has to do with not noticing a failed boundary condition.
  • It’s still very easy to trip over details, e.g. choosing if versus while to get to a viable starting value, using <=> versus just <>, plussing or minusing 1 when getting the length of a string. There’s also the case where testing one condition before another makes a difference.
  • There’s understanding a problem, but there’s really understanding a problem. Even a seemingly simple problem can evoke a highly sophisticated algorithm. An algorithm might also appear easy to understand initially, but the details of why certain operations are included or ommitted can get very complex and takes ages to truly digest.
  • It takes a lot of repetition to iron out true understanding.