TeachToTech
posttoteachtotech@gmail.com
Recursion
Q1. Implement pow(x,n), which calculates x raised to the power n (i.e., xn).
Link - https://leetcode.com/problems/powx-n/description/
Q2. We define super digit of an integer using the following rules:
Given an integer, we need to find the super digit of the integer.
If has x only 1 digit, then its super digit is x.
Otherwise, the super digit of x is equal to the super digit of the sum of the
digits of x.
Link - Recursive Digit Sum | HackerRank
Q3. Leetcode – 1922 count good numbers
Link - Count Good Numbers - LeetCode
Q4. Given an integer array nums of unique elements, return all
possible subsets (the power set).
The solution set must not contain duplicate subsets. Return the solution in any
order.
Link - Subsets - LeetCode
Q5. Given an integer array nums that may contain duplicates, return all
possible subsets (the power set).
The solution set must not contain duplicate subsets. Return the solution in any
order.
Link - Subsets II - LeetCode
Q6. Given a string containing digits from 2-9 inclusive, return all possible letter
combinations that the number could represent. Return the answer in any order.
A mapping of digits to letters (just like on the telephone buttons) is given below.
Note that 1 does not map to any letters.
Link - https://leetcode.com/problems/letter-combinations-of-a-phone-
number/description/
Q7. There is a robot on an m x n grid. The robot is initially located at the top-left
corner (i.e., grid[0][0]). The robot tries to move to the bottom-right
corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any
point in time.
Given the two integers m and n, return the number of possible unique paths that
the robot can take to reach the bottom-right corner.
Contact: + 911204480203 | www.teachtotech.in
TeachToTech
posttoteachtotech@gmail.com
The test cases are generated so that the answer will be less than or equal to 2 *
109.
Link - https://leetcode.com/problems/unique-paths/description/
Q8. Given an array nums of distinct integers, return all the possible permutations.
You can return the answer in any order.
Link -
https://leetcode.com/problems/permutations/description/?envType=problem-list-
v2&envId=backtracking
Q9. Given a string s and a dictionary of strings wordDict, return true if s can be
segmented into a space-separated sequence of one or more dictionary words.
Link - https://leetcode.com/problems/word-break/description/
Q10. You are given an integer array nums and an integer target.
You want to build an expression out of nums by adding one of the
symbols '+' and '-' before each integer in nums and then concatenate all the
integers.
Link - https://leetcode.com/problems/target-sum/description/?envType=problem-
list-v2&envId=backtracking
Q11. Given n pairs of parentheses, write a function to generate all combinations
of well-formed parentheses.
Link - https://leetcode.com/problems/generate-
parentheses/description/?envType=problem-list-v2&envId=backtracking
Q12. Given a collection of numbers, nums, that might contain duplicates,
return all possible unique permutations in any order.
Link - Permutations II - LeetCode
Q13. Given a string s, partition s such that every substring of the partition is
a palindrome. Return all possible palindrome partitioning of s.
Link - Palindrome Partitioning - LeetCode
Q14. Transformation A to B
Link - Problem - A - Codeforces
Q15. Pyramid Of Glasses
Link - Problem - B - Codeforces
Contact: + 911204480203 | www.teachtotech.in
TeachToTech
posttoteachtotech@gmail.com
Q16. Rat in a maze
Link - Rat in a Maze Problem - I | Practice | GeeksforGeeks
Q17. Given an array of positive integers arr[] and a value sum, determine if there
is a subset of arr[] with sum equal to given sum.
Link - Subset Sum Problem | Practice | GeeksforGeeks
Q18. Given an integer array nums, return true if you can partition the array into
two subsets such that the sum of the elements in both subsets is equal
or false otherwise.
Link - Partition Equal Subset Sum - LeetCode
Q19. Josephus problem
Link - Josephus problem | Practice | GeeksforGeeks
Q20. Standard questions – Nqueens, sudoku solver
Contact: + 911204480203 | www.teachtotech.in