Recursion and Backtracking

47 problems to practice.

47 Total
22 Easy
20 Medium
5 Hard

Permutation - 1

1. You are give a number of boxes (nboxes) and number of non-identical items (ritems). 2. You are r...

easy

Combinations - 1

1. You are give a number of boxes (nboxes) and number of identical items (ritems). 2. You are requi...

medium

Permutations - 2

1. You are give a number of boxes (nboxes) and number of non-identical items (ritems). 2. You are r...

medium

Combinations - 2

1. You are give a number of boxes (nboxes) and number of identical items (ritems). 2. You are requi...

medium

Permutations - Words - 1

1. You are given a word (may have one character repeat more than once). 2. You are required to gene...

easy

Permutations - Words - 2

1. You are given a word (may have one character repeat more than once). 2. You are required to gen...

easy

Words - K Selection - 1

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Selection - 2

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Length Words - 1

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Length Words - 2

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Selection - 3

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Selection - 4

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Length Words - 3

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Words - K Length Words - 4

1. You are given a word (may have one character repeat more than once). 2. You are given an integer...

easy

Coin Change - Combinations - 1

1. You are given a number n, representing the count of coins. 2. You are given n numbers, represent...

medium

Coin Change - Combinations - 2

1. You are given a number n, representing the count of coins. 2. You are given n numbers, represent...

medium

Coin Change - Permutations - 1

1. You are given a number n, representing the count of coins. 2. You are given n numbers, represent...

medium

Coin Change - Permutations - 2

1. You are given a number n, representing the count of coins. 2. You are given n numbers, represent...

medium

Queens Combinations - 2d As 2d - Box Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Queens Permutations - 2d As 2d - Queen Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Queens Permutations - 2d As 2d - Box Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Queens Combinations - 2d As 2d - Queen Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Queens Combinations - 2d As 1d - Queen Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Nqueens Combinations - 2d As 1d - Queen Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Nknights Combinations - 2d As 1d - Knight Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

medium

Friends Pairing - 2

1. You are given an integer n, which represents n friends numbered from 1 to n. 2. Each one can rem...

easy

K-partitions

1. You are given two integers n and k, where n represents number of elements and k represents...

easy

All Palindromic Permutations

1. You are given a string of length n. 2. You have to print all the palindromic permutations of the...

medium

All Palindromic Partitions

1. You are given a string of length n. 2. You have to partition the given string in such a way that...

medium

K Subsets With Equal Sum

1. You are given an array of n distinct integers. 2. You have to divide these n integers into k non...

medium

Tug Of War

1. You are given an array of n integers. 2. You have to divide these n integers into 2 subsets such...

easy

Pattern Matching

1. You are given a string and a pattern. 2. You've to check if the string is of the same structure...

medium

Word Break - I

1. You are given n space separated strings, which represents a dictionary of words. 2. You are give...

easy

Remove Invalid Parenthesis

1. You are given a string, which represents an expression having only opening and closing parenthesi...

hard

Largest Number Possible After At Most K Swaps

1. You are given a string which represents digits of a number. 2. You have to create the maximum nu...

easy

Gold Mine - 2

1. You are given a number n, representing the number of rows. 2. You are given a number m, represen...

easy

Solve Sudoku

1. You are give a partially filled 9*9 2-D array(arr) which represents an incomplete sudoku state....

hard

Crossword Puzzle

1. You are given a 10*10 2-D array(arr) containing only '+' and '-' characters, which represents a...

easy

Cryptarithmetic

1. You are given three strings s1, s2 and s3. 2. First two are supposed to add and form third. s1 +...

easy

Magnets

1. You are given n number of domino shaped bipolar magnets. 2. You have to place these magnets in M...

hard

Lexicographical Numbers

1. You are given a number. 2. You have to print all the numbers from 1 to n in lexicographical orde...

medium

Josephus Problem

1. You are given two numbers N and K. 2. N represents the total number of soldiers standing in a ci...

easy

Max Score

1. You are given a list of words, a list of alphabets(might be repeating) and score of every alphabe...

hard

N Queens - Branch And Bound

1. You are given a number n, the size of a chess board. 2. You are required to place n number of qu...

hard

Abbreviation Using Backtracking

1. You are given a word. 2. You have to generate all abbrevations of that word. Use recursion as...

medium

Nqueens Permutations - 2d As 1d - Queen Chooses

1. You are given a number n, representing the size of a n * n chess board. 2. You are required to c...

easy

Restore Ip Addresses

https://leetcode.com/problems/restore-ip-addresses/

easy