Day 8 of my LeetCode streak 🚀
Today’s problem was 165. Compare Version Numbers — a neat string parsing challenge where the tricky part isn’t the logic itself, but handling all the little details:
- Ignoring leading zeros ("01" = "001")
- Treating missing revisions as 0 ("1.0" = "1.0.0")
- Comparing uneven revision lengths
I solved it in JavaScript by splitting the version strings into arrays, comparing each part as integers, and defaulting to 0 when one version runs out of parts.
Even on a distracted day (hello, Twitter doomscrolling 😅), keeping the streak alive matters.
👉 Full breakdown with code and reflections on my blog:
https://nitinahirwal.in/posts/165-CompareVersionNumbers
On to Day 9! 🚀
Top comments (0)