Category

Problems

Programming problems with multi-language solutions, complexity analysis, and explanations.

94 articles

Filter: All Easy Medium Hard
Easy

Easy Problems

34
Easy Contains Duplicate Array · Hash Table · Sorting Easy Excel Sheet Column Number Algorithm · Math · String Easy Linked List Cycle Detection Algorithm · Linked List · Two Pointers Easy Happy Number Hash Table · Math · Two Pointers Easy Symmetric Tree BFS · Binary Tree · Recursion Easy Reverse Integer Algorithm · Math Easy Maximum Depth of Binary Tree BFS · Binary Tree · Recursion Easy Palindrome Number Check Algorithm · Math Easy Reverse Linked List Algorithm · Linked List · Recursion Easy Valid Parentheses Algorithm · Stack · String Easy Binary Search Algorithm · Array · Binary Search Easy Merge Two Sorted Linked Lists Algorithm · Linked List · Recursion Easy Merge Sorted Array (In-Place) Array · Sorting · Two Pointers Easy Remove Duplicates from Sorted Array Array · Two Pointers Easy Pascal’s Triangle Array · Dynamic Programming · Math Easy Plus One: Increment Array Number Array · Math Easy Power of Two Algorithm · Bit Manipulation · Math Easy Climbing Stairs Dynamic Programming · Math · Recursion Easy Missing Number in Range Array · Bit Manipulation · Math Easy Maximum Subarray (Kadane’s Algorithm) Algorithm · Array · Dynamic Programming Easy Intersection of Two Arrays Array · Hash Table · Two Pointers Easy Best Time to Buy and Sell Stock Algorithm · Array · Dynamic Programming Easy Sqrt(x): Integer Square Root Algorithm · Binary Search · Math Easy Single Number: Find the Unique Element Algorithm · Array · Bit Manipulation Easy Count Primes Below N Algorithm · Math · Sieve Easy Valid Anagram Hash Table · Sorting · String Easy Roman to Integer Hash Table · Math · String Easy First Unique Character in a String Algorithm · Hash Table · String Easy Implement strStr (Substring Search) Algorithm · String · Two Pointers Easy Move Zeroes to End Algorithm · Array · Two Pointers Easy FizzBuzz Algorithm · Math · String Easy Two Sum: Find Pair That Adds Up to Target Algorithm · Array · Hash Table Easy Reverse a String In-Place Algorithm · String · Two Pointers Easy Fibonacci Number: Iterative and Recursive Dynamic Programming · Math · Recursion
Medium

Medium Problems

30
Medium Unique Paths in Grid Algorithm · Dynamic Programming · Math Medium Product of Array Except Self Algorithm · Array · Prefix Sum Medium Sort Colors (Dutch National Flag) Array · Sorting · Two Pointers Medium Search in Rotated Sorted Array Algorithm · Array · Binary Search Medium Add Two Numbers (Linked List) Linked List · Math · Recursion Medium Combination Sum Array · Backtracking · Recursion Medium Longest Substring Without Repeating Characters Hash Table · Sliding Window · String Medium Permutations of an Array Array · Backtracking · Recursion Medium Longest Palindromic Substring Dynamic Programming · String · Two Pointers Medium Subsets (Power Set) Array · Backtracking · Bit Manipulation Medium String to Integer (atoi) Algorithm · Math · String Medium Word Search in Grid Array · Backtracking · DFS Medium Container With Most Water Array · Greedy · Two Pointers Medium Validate Binary Search Tree Binary Tree · BST · Recursion Medium 3Sum: Find Unique Triplets That Sum to Zero Array · Sorting · Two Pointers Medium Binary Tree Level Order Traversal BFS · Binary Tree · Queue Medium Generate All Valid Parentheses Combinations Backtracking · Recursion · String Medium Course Schedule (Detect Cycle) DFS · Graph · Topological Sort Medium Group Anagrams Hash Table · Sorting · String Medium Number of Islands BFS · DFS · Graph Medium Pow(x, n): Fast Exponentiation Algorithm · Math · Recursion Medium House Robber: Maximize Loot Algorithm · Array · Dynamic Programming Medium Rotate Image (90 Degrees) Array · Math · Matrix Medium Coin Change: Fewest Coins for Amount Array · BFS · Dynamic Programming Medium Spiral Matrix Traversal Algorithm · Array · Matrix Medium Letter Combinations of a Phone Number Backtracking · Recursion · String Medium Jump Game: Can You Reach the End? Array · Dynamic Programming · Greedy Medium Find First and Last Position Algorithm · Array · Binary Search Medium Merge Overlapping Intervals Algorithm · Array · Sorting Medium Top K Frequent Elements Array · Hash Table · Heap
Hard

Hard Problems

30
Hard Serialize and Deserialize Binary Tree BFS · Binary Tree · Design Hard Median of Two Sorted Arrays Algorithm · Array · Binary Search Hard Regular Expression Matching Dynamic Programming · Recursion · String Hard Trapping Rain Water Array · Dynamic Programming · Two Pointers Hard Word Break II: All Sentences Backtracking · Dynamic Programming · String Hard Merge K Sorted Lists Divide and Conquer · Heap · Linked List Hard Wildcard Matching Dynamic Programming · Greedy · String Hard First Missing Positive Integer Algorithm · Array · Hash Table Hard Longest Valid Parentheses Dynamic Programming · Stack · String Hard N-Queens Algorithm · Backtracking · Recursion Hard Palindrome Partitioning II Algorithm · Dynamic Programming · String Hard Edit Distance (Levenshtein) Algorithm · Dynamic Programming · String Hard Burst Balloons Algorithm · Array · Dynamic Programming Hard Word Ladder: Shortest Transformation BFS · Graph · String Hard Maximal Rectangle Dynamic Programming · Matrix · Stack Hard Find Median from Data Stream Algorithm · Design · Heap Hard Best Time to Buy and Sell Stock III (Two Transactions) Algorithm · Array · Dynamic Programming Hard Largest Rectangle in Histogram Array · Monotonic Stack · Stack Hard Recover Binary Search Tree Binary Tree · BST · Recursion Hard Sliding Window Maximum Array · Deque · Sliding Window Hard Substring with Concatenation of All Words Hash Table · Sliding Window · String Hard Reverse Nodes in K-Group Algorithm · Linked List · Recursion Hard Word Search II Backtracking · DFS · Trie Hard Binary Tree Maximum Path Sum Binary Tree · Dynamic Programming · Recursion Hard Distinct Subsequences Algorithm · Dynamic Programming · String Hard Longest Consecutive Sequence Algorithm · Array · Hash Table Hard Russian Doll Envelopes Array · Dynamic Programming · Sorting Hard LRU Cache Design · Hash Table · Linked List Hard Shortest Path in Binary Matrix BFS · Graph · Matrix Hard Minimum Window Substring Hash Table · Sliding Window · String