Combinatorics: Easy to Hard Problems
Easy
- Pascal’s Triangle (Generates Pascal’s triangle up to a given number of rows)
- Combination Sum IV (Finds the number of possible combinations that add up to a target value)
- Climbing Stairs (Finds the number of ways to climb stairs with a given number of steps)
- Count Primes (Counts the number of prime numbers less than a given number)
- Letter Combinations of a Phone Number (Generates all possible letter combinations for a phone number)
Medium
- Permutations II (Generates all unique permutations of a list of numbers)
- N-Queens II (Counts all distinct solutions for the N-Queens problem)
- Combination Sum II (Finds unique combinations that sum up to a target, allowing for duplicates)
- Unique Paths II (Finds the number of unique paths in a grid with obstacles)
- Subsets II (Generates all unique subsets of a list of numbers with possible duplicates)
Hard
- Sudoku Solver (Solves a Sudoku puzzle using backtracking)
- Palindromic Substrings (Counts distinct palindromic substrings in a string)
- Count of Smaller Numbers After Self (Counts the number of smaller elements after each element using merge sort)
- All Possible Full Binary Trees (Generates all possible full binary trees with a given number of nodes)
- Kth Largest Element in an Array (Finds the Kth largest element in an unsorted array)