~/lc-grind
#130 - Surrounded Regions
Nov 25, 2025Flip all 'O's to 'X's except for those connected to the board's edge, which cannot be surrounded.
#530 - Minimum Absolute Difference in BST
Nov 24, 2025Traverse this Binary Search Tree in-order to compare consecutive node values and find the smallest possible difference between any two nodes.
#103 - Binary Tree Zigzag Level Order Traversal
Nov 21, 2025Traverse a binary tree level by level, but switch the direction (left-to-right, then right-to-left) after each level for a zigzag pattern.
#637 - Average of Levels in Binary Tree
Nov 20, 2025Efficiently compute the average value of nodes at each level of a binary tree using BFS or DFS traversal.
#199 - Binary Tree Right Side View
Nov 19, 2025Capture the rightmost node at each level of a binary tree to reveal its unique "side view" from top to bottom.
#236 - Lowest Common Ancestor of a Binary Tree
Nov 18, 2025Master the classic tree traversal problem of finding the deepest node that is a common ancestor to two given nodes in a binary tree.
#222 - Count Complete Tree Nodes
Nov 14, 2025Leverage the properties of a complete binary tree to count its nodes in O(log² N) time by combining binary search with height comparisons.
#173 - Binary Search Tree Iterator
Nov 13, 2025Efficiently traverse a Binary Search Tree in-order, one element at a time, using a stack-based iterator that operates in O(1) average time and O(h) memory.
#129 - Sum Root to Leaf Numbers
Nov 12, 2025Traverse every root-to-leaf path in this binary tree, where each path forms a unique number, and return the sum of all these numbers.
#112 - Path Sum
Nov 11, 2025Determine if a simple path from the root to any leaf in a binary tree adds up to the given target sum.