Backtracking

Shortest Path in 2D Array
AskAI

This problem is about finding the shortest path through a 2D array of black and white pixels. The input is a 2D array of 0s and 1s, and the output is the length of the shortest path from the top left to the bottom right.

Print the size of the largest subset of distinct integers where the sum of...
AskAI

Given a set of distinct integers, this code prints the size of the largest subset where the sum of any two numbers is not evenly divisible by a given number.

Is This Sudoku Board Valid?
AskAI

The function should take in a 2D array of integers and return true if the array is a valid sudoku board, and false otherwise.

All possible permutations of a set of distinct integers
AskAI

This problem is about finding all possible permutations of a 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 of Consecutive Numbers in a 2D Array
AskAI

Given a 2D array, this problem seeks to find the length of the longest path of consecutive numbers that can be formed starting from any cell. The path can move in any of the 8 directions.

Is the 2D Array a Valid Sudoku Puzzle?
AskAI

This function returns true if the given 2D array is a valid Sudoku puzzle, and false otherwise. A valid Sudoku puzzle is one in which each row, column, and 3x 3 sub-array contains all of the integers from 1 to 9 with no repeats.

Find the Longest Path of Consecutive Numbers in a 2D Array
AskAI

Given a 2D array of integers, this problem looks for the longest path of consecutive numbers that can be formed in the array. The path can start and end at any location in the array , and the example output given is 6.

Find the Longest Path in a 2D Array
AskAI

Given a 2D array of integers, find the length of the longest path of consecutive numbers that can be formed. The path can start and end at any position in the array.