Consider a rat placed at position (0, 0) in an n x n square matrix mat[][]. The rat’s goal is to reach the…
Browsing: Advance Recursion
The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an…
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any…
Find all valid combinations of k numbers that sum up to n such that the following conditions are true: Return a list of all possible…
Given a array arr of integers, return the sums of all subsets in the list. Return the sums in any order. Here’s…
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers…
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the…
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Here’s the [Problem Link] to begin with. Example…
Given an integer N , Print all binary strings of size N which do not contain consecutive 1s. A binary string is that string…
Given an array arr of non-negative integers and an integer target, the task is to count all subsets of the array whose sum…