07 2020 档案
摘要:Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1: Input: "eceba" Output: 3 Explana
阅读全文
摘要:Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer
阅读全文
摘要:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Input: S = "ADOB
阅读全文
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont
阅读全文
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [
阅读全文
摘要:Write a function to generate the generalized abbreviations of a word. Note: The order of the output does not matter. Example: Input: "word" Output: ["
阅读全文
摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the d
阅读全文
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o
阅读全文
摘要:A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that are o
阅读全文
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. A valid IP address consists of exactly four
阅读全文
摘要:所谓优化剪枝策略,就是判断当前的分支树是否符合问题的条件,如果当前分支树不符合条件,那么就不再遍历这个分支里的所有路径。回溯算法使用剪枝函数,剪去一些不可能到达 最终状态(即答案状态)的节点,从而减少状态空间树节点的生成。 有个解空间,要从里面挑。有条件,不符合就剪枝:一般是数组长度够了就行了可是一
阅读全文
摘要:Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le
阅读全文
摘要:Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le
阅读全文
摘要:Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac
阅读全文
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen
阅读全文
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo
阅读全文
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo
阅读全文
摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su
阅读全文
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: I
阅读全文
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb
阅读全文
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb
阅读全文
摘要:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the
阅读全文

浙公网安备 33010602011771号