Given a set of distinct integers, this algorithm will return all possible subsets. For example, if the input is [1,2,3], the output will be [[],[1],[ 2],[3],[1,2],[1,3],[2,3],[1,2,3]].
Given a 2D array of integers, this algorithm finds the length of the longest path of 1's in the array. The path can start and end at any position in the array.
This problem asks for all possible permutations of a set of distinct integers.
Given a 2D array of integers, write a function that returns 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.
This problem deals with finding all possible subsets of a set of distinct integers. The elements in each subset must be in non-descending order, and the solution set must not contain duplicate subsets.
The N-Queens problem is a classic problem in computer science that can be solved using a backtracking algorithm. Given a chessboard of size N, the goal is to place N queens on the board such that no two queens are in the same row, column, or diagonal. This problem can be solved using a backtracking algorithm that finds all possible solutions and outputs them as a list .
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers. The first two numbers in the sequence are 1 and 1, and the third number is 2. The fourth number is 3, the fifth number is 5, and so on. The function takes in a number n and prints out the first n numbers of the Fibonacci sequence .
Find the minimum path sum in a 2D array from the top-left corner to the bottom-right corner.