Today was all about strings β not the musical ones πΈ but the tricky coding ones.
I jumped into some advanced string problems, and wow, they really stretched my brain.
Problems I tackled:
π [76] Minimum Window Substring β Sliding window at its finest. Took a while to wrap my head around all the shrinking and expanding, but itβs honestly such a beautiful pattern.
β [20] Valid Parentheses β Classic stack problem. Still satisfying every single time the brackets line up just right.
β [415] Add Strings β No built-in big integer magic here, just pure digit-by-digit addition like we did in school.
π [151] Reverse Words in a String β Reminded me that trimming spaces and reversing arenβt as simple as they sound.
π± [14] Longest Common Prefix β Surprisingly elegant once you see the trick of comparing characters across strings.
π‘ Takeaways:
Sliding window problems demand patience (and lots of debugging π ).
Stacks are lifesavers when things need to stay in order.
Sometimes coding feels like going back to primary school math (and thatβs not a bad thing).
"Simple" string problems can hide messy details β trimming spaces, handling edge cases, etc.
β¨ Thatβs a wrap for Day 4. Strings may look simple, but they sure know how to test logic and patience. On to Day 5 tomorrow!
Top comments (0)