The O(n) Club3 Min Read dgtalbugonJuly 20, 2025 The O(n) Club: Shortest Bridge — When DFS and BFS Join Forces (and Regret It Immediately) The O(n) Club: Shortest Bridge — When DFS and BFS Join Forces (and Regret It Immediately) ⚡ TL;DR Connect two islands in a binary grid by… Discover More
The O(n) Club3 Min Read dgtalbugonJuly 19, 2025 The O(n) Club: Deepest Leaves Sum — BFS to the Rescue (Again) The O(n) Club: Deepest Leaves Sum — BFS to the Rescue (Again) ⚡ TL;DR Quick summary: Find every leaf node chilling at the bottom of the tree… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 19, 2025 The O(n) Club: Pascal’s Triangle II, or How to Mutate Arrays Without Crying The O(n) Club: Pascal’s Triangle II, or How to Mutate Arrays Without Crying ⚡ TL;DR Pascals’s Triangle II: You want rowIndex-th row (0-based)… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 18, 2025 The O(n) Club: Frog Jump: Can Your Recursion Swim, or Will It Croak? The O(n) Club: Frog Jump — Can Your Recursion Swim, or Will It Croak? ⚡ TL;DR Frog at stone 0 wants to land on the last stone, only jumping… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 18, 2025 The O(n) Club: Maximum Difference Between Node and Ancestor: Not Your Parent’s Binary Tree Drama The O(n) Club: Maximum Difference Between Node and Ancestor ⚡ TL;DR If you want the maximum absolute difference between a node and any… Discover More
The O(n) Club3 Min Read dgtalbugonJuly 17, 2025 The O(n) Club: Most Stones Removed with Same Row or Column: Stone-Crushing Group Therapy The O(n) Club: Most Stones Removed with Same Row or Column — Stone-Crushing Group Therapy ⚡ TL;DR Imagine every stone is a bored dev at a… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 17, 2025 The O(n) Club: Turning Your String Into a Narcissist—Shortest Palindrome Edition The O(n) Club: Turning Your String Into a Narcissist—Shortest Palindrome Edition ⚡ TL;DR You want to turn your string s into the shortest… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 16, 2025 The O(n) Club: LeetCode 670 Maximum Swap — Greedy Digit Hustle Unleashed The O(n) Club: LeetCode 670 Maximum Swap — Greedy Digit Hustle Unleashed ⚡ TL;DR Got a non-negative integer? Swap two digits (once) to get the… Discover More
The O(n) Club1 Min Read dgtalbugonJuly 16, 2025 The O(n) Club: Running Sum of 1D Array – Because If You Can’t Count, You Can’t Code The O(n) Club: Running Sum of 1D Array – Because If You Can’t Count, You Can’t Code ⚡ TL;DR Add up each number as you go; every… Discover More
The O(n) Club2 Min Read dgtalbugonJuly 15, 2025 The O(n) Club: Max Consecutive Ones: Give Your CPU a Break, Not a Headache The O(n) Club: Max Consecutive Ones — Give Your CPU a Break, Not a Headache ⚡ TL;DR Want the longest streak of 1s in a binary array? Count as… Discover More