Saltar al contenido principal

9 documentos etiquetados con "backtracking"

Ver Todas las Etiquetas

Combination Sum

This question is asked by Apple. Given a list of positive numbers without duplicates and a target number, find all unique combinations of the numbers that sum to the target.

Generate Parentheses

This question is asked by Facebook. Given an integer N, where N represents the number of pairs of parentheses (i.e. "(" and ")") you are given, return a list containing all possible well-formed parentheses you can create.

Letter Case Permutation

This question is asked by Amazon. Given a string s consisting of only letters and digits, where we are allowed to transform any letter to uppercase or lowercase, return a list containing all possible permutations of the string.

Palindrome Partitioning

This question is asked by Google. Given a string s, return all possible partitions of s such that each substring is a palindrome.

Path with Maximum Gold

This question is asked by Amazon. Given a 2D matrix that represents a gold mine, where each cell's value represents an amount of gold, return the maximum amount of gold you can collect given the following rules:

Remove Invalid Parentheses

Given a string s, remove the minimum number of parentheses to make s valid. Return all possible results.

Word Search

This question is asked by Amazon. Given a 2D board that represents a word search puzzle and a string word, return whether or the given word can be formed in the puzzle by only connecting cells horizontally and vertically.