The O(n) Club2 Min Read dgtalbugonJuly 25, 2025 The O(n) Club: Number of Good Pairs – Because Nested Loops Deserve Retirement The O(n) Club: Number of Good Pairs – Because Nested Loops Deserve Retirement ⚡ TL;DR Count (i, j) with nums[i] == nums[j] and i <… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 24, 2025 The O(n) Club: Contains Duplicate II: Because Sometimes Your Bugs Are Neighbors The O(n) Club: Contains Duplicate II, Because Sometimes Your Bugs Are Neighbors ⚡ TL;DR You’re not hunting for ordinary duplicates;… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 24, 2025 The O(n) Club: Can Place Flowers—Or How to Not Plant a Bug Farm The O(n) Club: Can Place Flowers—Or How to Not Plant a Bug Farm ⚡ TL;DR You’ve got a 0-1 array (flowerbed), a number n, and a simple dream:… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 23, 2025 The O(n) Club: Shortest Distance to a Character — Why Single Pass Devs Cry Twice The O(n) Club: Shortest Distance to a Character — Why Single Pass Devs Cry Twice ⚡ TL;DR You want the minimum distance from every index in a… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 23, 2025 The O(n) Club: Find Common Characters — Where Duplicate Letters Are Finally Invited The O(n) Club: Find Common Characters — Where Duplicate Letters Are Finally Invited ⚡ TL;DR Want every letter that appears in all strings,… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 22, 2025 The O(n) Club: Increasing Order Search Tree: When Your BST Just Wants to Be a Queue The O(n) Club: Increasing Order Search Tree—When Your BST Just Wants to Be a Queue ⚡ TL;DR If your BST refuses to queue up nicely, tell it:… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 22, 2025 The O(n) Club: Robot Bounded in Circle—How to Stop Your Robot From Moonwalking to Infinity The O(n) Club: Robot Bounded in Circle—How to Stop Your Robot From Moonwalking to Infinity ⚡ TL;DR Does your robot know when to stop, or is it… Discover More
The O(n) Club3 Min Read dgtalbugonJuly 21, 2025 The O(n) Club: Sliding Window Buckets and the Art of Almost-Duplicates (LeetCode 220) The O(n) Club: Sliding Window Buckets and the Art of Almost-Duplicates (LeetCode 220) ⚡ TL;DR Don’t want to wreck your runtime with… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 21, 2025 The O(n) Club: Super Egg Drop — How to Crack It Without Losing All Your Eggs (or Dignity) The O(n) Club: Super Egg Drop — How to Crack It Without Losing All Your Eggs (or Dignity) ⚡ TL;DR Given k eggs and n floors, how few moves do… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 20, 2025 The O(n) Club: Bitwise AND of Numbers Range — or, Why Naive Loops Cry The O(n) Club: Bitwise AND of Numbers Range — or, Why Naive Loops Cry ⚡ TL;DR Bitwise AND from left to right: all differing bits will be… Discover More