~/lc-grind
#34 - Find First and Last Position of Element in Sorted Array
Dec 23, 2025Master the classic binary search technique to efficiently locate the first and last occurrence of a target in a sorted array, returning [-1, -1] if it's not found.
#162 - Find Peak Element
Dec 22, 2025Discover how to efficiently locate any peak element in an array using binary search, achieving O(log n) time complexity.
#74 - Search a 2D Matrix
Dec 19, 2025Master the classic "Search a 2D Matrix" problem by leveraging binary search on a sorted matrix to find a target in O(log(m*n)) time.
#35 - Search Insert Position
Dec 18, 2025Find the correct insertion index for a target value in a sorted array using an efficient O(log n) binary search approach.
#918 - Maximum Sum Circular Subarray
Dec 17, 2025Master the challenge of finding the maximum sum subarray in a circular array by leveraging Kadane's algorithm to handle both standard and wrap-around cases.
#427 - Construct Quad Tree
Dec 16, 2025Master the classic divide-and-conquer technique by learning how to recursively build a Quad-Tree from a binary matrix.
#148 - Sort List
Dec 15, 2025Master the classic challenge of sorting a singly linked list in O(n log n) time using an in-place merge sort algorithm.
#108 - Convert Sorted Array to Binary Search Tree
Dec 12, 2025Learn how to transform a sorted array into a height-balanced binary search tree using a simple divide-and-conquer approach that picks the middle element as the root.
#52 - N-Queens II
Dec 11, 2025Count the distinct ways to place n queens on an n×n chessboard without any two threatening each other, a classic backtracking challenge.
#39 - Combination Sum
Dec 10, 2025Find all unique combinations of numbers from a given array that sum to a target, where each number can be used an unlimited number of times.