Skip to main content

28 docs tagged with "Backtracking"

View all tags

Binary Watch

This is a solution to the Binary Watch problem on LeetCode.

Combination Sum-II(LeetCode)

Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target.

Combination Sum(LeetCode)

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.

Combinations(LeetCode)

Given two integers n and k, return all possible combinations of k numbers chosen from the range [1, n].

N-Queens Puzzle

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.

Paths to Reach Origin

This document explores finding the number of paths to reach the origin (0, 0) on a grid.

Permutation-2

Given a collection of numbers, nums, that might contain duplicates, return all possible unique permutations in any order.

Permutations(LeetCode)

Given an array `nums` of distinct integers, return all the possible permutations. You can return the answer in any order.

Unique Paths III

Find the number of unique paths from the starting square to the ending square in a grid, walking over every non-obstacle square exactly once.

Word Break II

This document provides solutions for the Word Break II problem.

Word Search II

This document provides a solution to the Word Search II problem, where we need to return all words on the board, given an mXn board of characters and a list of strings words.

Word Search(LeetCode)

Given an m x n grid of characters board and a string word, return true if word exists in the grid.