The O(n) Club2 Min Read dgtalbugonJanuary 31, 2025 The O(n) Club: Invert Binary Tree – Mirror Mayhem and Recursive Therapy The O(n) Club: Invert Binary Tree – Mirror Mayhem and Recursive Therapy ⚡ TL;DR Take a binary tree and swap every left and right… Discover More
The O(n) Club2 Min Read dgtalbugonJanuary 31, 2025 The O(n) Club: Preorder-Inorder Tree Rebuilds — Actually Fun, Actually Linear The O(n) Club: Preorder-Inorder Tree Rebuilds — Actually Fun, Actually Linear ⚡ TL;DR Want to turn two scrambled traversals back into a… Discover More
The O(n) Club3 Min Read dgtalbugonJanuary 30, 2025 The O(n) Club: Regular Expression Matching — When ‘.’ and ‘*’ Run the Show The O(n) Club: Regular Expression Matching — When ‘.’ and ‘*’ Run the Show ⚡ TL;DR Match string s against pattern p… Discover More
The O(n) Club3 Min Read dgtalbugonJanuary 30, 2025 The O(n) Club: Edit Distance — When Strings Need Surgery (LeetCode 72) The O(n) Club: Edit Distance — When Strings Need Surgery (LeetCode 72) ⚡ TL;DR How do you transform one string into another with as few… Discover More
The O(n) Club3 Min Read dgtalbugonJanuary 29, 2025 The O(n) Club: Palindrome Linked List: Sanity-Check Edition—Because Lists Deserve Symmetry Too The O(n) Club: Palindrome Linked List—Sanity-Check Edition ⚡ TL;DR Want to see if your singly linked list reads the same from both ends, but… Discover More
The O(n) Club2 Min Read dgtalbugonJanuary 29, 2025 The O(n) Club: Rotate Image Without Losing Your Mind (LeetCode 48) The O(n) Club: Rotate Image Without Losing Your Mind (LeetCode 48) ⚡ TL;DR Rotate your n x n matrix 90° in-place by: (1) transposing (swap… Discover More
The O(n) Club2 Min Read dgtalbugonJanuary 28, 2025 The O(n) Club: Unique Paths—How Many Ways Can a Robot Survive the Grid? The O(n) Club: Unique Paths—How Many Ways Can a Robot Survive the Grid? ⚡ TL;DR Counting how many ways a robot can go from the top-left to… Discover More
The O(n) Club2 Min Read dgtalbugonJanuary 28, 2025 The O(n) Club: Majority Element — The Array’s Unbeatable Bully The O(n) Club: Majority Element — The Array’s Unbeatable Bully ⚡ TL;DR The Majority Element is the number that turns your array into a… Discover More
The O(n) Club2 Min Read dgtalbugonJanuary 27, 2025 The O(n) Club: Linked Lists Intersection — Y-Junctions, Off-By-One Fails, and Pointer Shenanigans The O(n) Club: Linked Lists Intersection — Y-Junctions, Off-By-One Fails, and Pointer Shenanigans ⚡ TL;DR Given two singly linked lists that… Discover More
The O(n) Club2 Min Read dgtalbugonJanuary 27, 2025 The O(n) Club: Move Zeroes — In-Place, In-Order, In-Interview Panic The O(n) Club: Move Zeroes — In-Place, In-Order, In-Interview Panic ⚡ TL;DR Move all zeroes to the end of your array—don’t use extra space,… Discover More