Backtracking

All Possible Subsets
AskAI

This problem asks you to return all possible subsets of a given set of distinct integers. For example, if the input is [1,2,3], then the output should include all possible subsets of those integers, such as [1],[2],[3],[1,2],[1,3],[2,3],[1,2,3], and the empty set.

Longest path in 2D array
AskAI

This problem involves finding the longest path of consecutive integers in a 2D array, starting from the top left corner. The path can move up, down, left, or right. An example input and output are provided.

Print all valid combinations of n-pairs of parentheses
AskAI

Given a positive integer n, print all valid combinations of n pairs of parentheses.

All Possible Permutations
AskAI

This problem is about finding all possible permutations of a given set of distinct integers. For example, if the input is [1,2,3], then the output should be [[1 ,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]].

Longest path in a 2D array
AskAI

Given a 2D array of integers, find the length of the longest path of consecutive integers starting from the top left corner of the array. The path can move up, down, left, or right.

Find the largest connected component of black pixels in a 2D array.
AskAI

This problem asks us to find the largest connected component of black pixels in a 2D array. We can do this by using a backtracking algorithm to keep track of which pixels are connected.

Longest Path in a 2D Array
AskAI

The problem is to find the longest path of consecutive integers in a 2D array, starting from the top left corner. The path can move left, right, up, or down.

All possible permutations
AskAI

Given a set of distinct integers, return all possible permutations using backtracking.