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 阅读全文
posted @ 2020-07-31 23:22 苗妙苗 阅读(123) 评论(0) 推荐(0)
摘要:Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer 阅读全文
posted @ 2020-07-31 11:19 苗妙苗 阅读(135) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-30 10:34 苗妙苗 阅读(122) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-28 11:02 苗妙苗 阅读(160) 评论(0) 推荐(0)
摘要: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: [ 阅读全文
posted @ 2020-07-27 23:16 苗妙苗 阅读(106) 评论(0) 推荐(0)
摘要:Write a function to generate the generalized abbreviations of a word. Note: The order of the output does not matter. Example: Input: "word" Output: [" 阅读全文
posted @ 2020-07-27 11:17 苗妙苗 阅读(98) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-27 01:44 苗妙苗 阅读(162) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-25 11:16 苗妙苗 阅读(100) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-25 06:41 苗妙苗 阅读(102) 评论(0) 推荐(0)
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. A valid IP address consists of exactly four 阅读全文
posted @ 2020-07-23 20:38 苗妙苗 阅读(172) 评论(0) 推荐(0)
摘要:所谓优化剪枝策略,就是判断当前的分支树是否符合问题的条件,如果当前分支树不符合条件,那么就不再遍历这个分支里的所有路径。回溯算法使用剪枝函数,剪去一些不可能到达 最终状态(即答案状态)的节点,从而减少状态空间树节点的生成。 有个解空间,要从里面挑。有条件,不符合就剪枝:一般是数组长度够了就行了可是一 阅读全文
posted @ 2020-07-18 10:02 苗妙苗 阅读(2541) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-18 08:18 苗妙苗 阅读(140) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-10 09:34 苗妙苗 阅读(161) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-07 23:01 苗妙苗 阅读(207) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-06 22:13 苗妙苗 阅读(161) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-06 11:01 苗妙苗 阅读(108) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-04 22:39 苗妙苗 阅读(128) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-03 05:51 苗妙苗 阅读(138) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2020-07-01 23:28 苗妙苗 阅读(113) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-07-01 08:11 苗妙苗 阅读(112) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-07-01 05:37 苗妙苗 阅读(99) 评论(0) 推荐(0)
摘要:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the 阅读全文
posted @ 2020-07-01 05:22 苗妙苗 阅读(155) 评论(0) 推荐(0)