0% found this document useful (0 votes)
4 views3 pages

Recursion Question TT

The document presents a series of algorithmic problems involving arrays and strings, including generating subsets, permutations, and valid parentheses combinations. It also covers finding unique combinations that sum to a target, checking for word existence in a grid, and generating valid IP addresses. Each problem is accompanied by example inputs and expected outputs.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

Recursion Question TT

The document presents a series of algorithmic problems involving arrays and strings, including generating subsets, permutations, and valid parentheses combinations. It also covers finding unique combinations that sum to a target, checking for word existence in a grid, and generating valid IP addresses. Each problem is accompanied by example inputs and expected outputs.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Subsets
Problem:
Given an integer array, return all possible subsets.

Input:
nums = [1,2,3]
Output:
[[],[1],[2],[3],[1,2],[1,3],[2,3],[1,2,3]]

2. Permutations
Problem:
Given an array, return all possible permutations.

Input:
nums = [1,2,3]
Output:
All permutations

3. Combination Sum
Problem:
Find all unique combinations where numbers sum to target.

Input:
candidates = [2,3,6,7], target = 7

4. Generate Parentheses
Problem:
Generate all valid parentheses combinations.

Input:
n = 3

5. Palindrome Partitioning
Problem:
Partition string such that every substring is palindrome.

Input:
s = "aab"
6. Word Search
Problem:
Check if a word exists in a 2D grid.

Input:

board =
A B C E
S F C S
A D E E

word = "ABCCED"

7. Letter Combinations of a Phone Number


Problem:
Return all possible letter combinations from digits.

Input:
digits = "23"

8. Subsets II
Problem:
Generate subsets but handle duplicates.

Input:
nums = [1,2,2]

9. Combination Sum II
Problem:
Find combinations without duplicates.

10. Restore IP Addresses


Problem:
Generate all valid IP addresses from string.

Input:
s = "25525511135"

You might also like