LeetCode中等难度刷题
tangyuan_sibal
每一份努力都值得期许
展开
-
求最长前缀子串---indexOf()
Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "".Example 1:Input: ["flower","flow","flight"]Output: ...原创 2019-04-20 21:01:32 · 461 阅读 · 0 评论 -
动态规划简单题小结
198、House RobberYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is th...原创 2019-04-27 17:08:07 · 263 阅读 · 0 评论 -
字符转为数字---一个奇怪的现象
Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from thi...原创 2019-04-19 21:03:15 · 174 阅读 · 0 评论 -
最长不重复的子串长度
Given a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:In...原创 2019-05-06 21:15:15 · 928 阅读 · 0 评论 -
求字符串的最长回文串-----Manacher's Algorithm 马拉车算法
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Example...原创 2019-05-10 19:49:47 · 345 阅读 · 0 评论 -
回溯法常用的解题模板和常见题型
文章目录1、什么是回溯法2、通用框架3、模板测试1、subSet2、Permutations3、 Combination Sum4、Palindrome Partitioning4、总结1、什么是回溯法wiki上面是这么说的在包含问题的所有解的解空间树中,按照深度优先搜索的策略,从根结点出发深度探索解空间树。当探索到某一结点时,要先判断该结点是否包含问题的解,如果包含,就从该结点出发继续探索...原创 2019-05-24 21:48:06 · 1409 阅读 · 0 评论