上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 77 下一页
摘要: 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 苗妙苗 阅读(119) 评论(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 苗妙苗 阅读(153) 评论(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 苗妙苗 阅读(104) 评论(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 苗妙苗 阅读(94) 评论(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 苗妙苗 阅读(158) 评论(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 苗妙苗 阅读(97) 评论(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 苗妙苗 阅读(96) 评论(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 苗妙苗 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 所谓优化剪枝策略,就是判断当前的分支树是否符合问题的条件,如果当前分支树不符合条件,那么就不再遍历这个分支里的所有路径。回溯算法使用剪枝函数,剪去一些不可能到达 最终状态(即答案状态)的节点,从而减少状态空间树节点的生成。 有个解空间,要从里面挑。有条件,不符合就剪枝:一般是数组长度够了就行了可是一 阅读全文
posted @ 2020-07-18 10:02 苗妙苗 阅读(2488) 评论(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 苗妙苗 阅读(133) 评论(0) 推荐(0) 编辑
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 77 下一页