avatar_url

Sandesh Rana | Python

I'm a developer from Himalayas, with a passion for crafting efficient and elegant code, with creativity and precision.

Combinatorics

21 Aug 2024 » programming, algorithm

Combinatorics: Easy to Hard Problems

Easy

  1. Pascal’s Triangle (Generates Pascal’s triangle up to a given number of rows)
  2. Combination Sum IV (Finds the number of possible combinations that add up to a target value)
  3. Climbing Stairs (Finds the number of ways to climb stairs with a given number of steps)
  4. Count Primes (Counts the number of prime numbers less than a given number)
  5. Letter Combinations of a Phone Number (Generates all possible letter combinations for a phone number)

Medium

  1. Permutations II (Generates all unique permutations of a list of numbers)
  2. N-Queens II (Counts all distinct solutions for the N-Queens problem)
  3. Combination Sum II (Finds unique combinations that sum up to a target, allowing for duplicates)
  4. Unique Paths II (Finds the number of unique paths in a grid with obstacles)
  5. Subsets II (Generates all unique subsets of a list of numbers with possible duplicates)

Hard

  1. Sudoku Solver (Solves a Sudoku puzzle using backtracking)
  2. Palindromic Substrings (Counts distinct palindromic substrings in a string)
  3. Count of Smaller Numbers After Self (Counts the number of smaller elements after each element using merge sort)
  4. All Possible Full Binary Trees (Generates all possible full binary trees with a given number of nodes)
  5. Kth Largest Element in an Array (Finds the Kth largest element in an unsorted array)