
leetcode算法类题目心得体会
文章平均质量分 77
xiaodidadada
程序猿一枚
展开
-
leetcode练习题5--最长回文子串
最长回文子串(longest Palindrome)①longest common substring将原字符串str1整个转置(reverse)得到str2,对str2的所有子字符串substr2,检查str1是否包含substr2,如果包含,这里要特别注意检查,substr2是否是一个回文串,例如str1=“bacac”,则str2=“cacab”,此时substr2=“cac”,正确,但是若...原创 2018-02-16 18:21:47 · 428 阅读 · 0 评论 -
leetcode:word search +word searchII总结
leetcode:word search +word searchII总结①word search:给定一个m x n的矩阵A[ ['A','B','C','E'], ['S','F','C','S'], ['A','D','E','E']],同时给定一个单词,例如word = "ABCCED", 在矩阵中任意连续不重复走动,若可以找到word对应的单词则返回true,否则返回false.主...原创 2018-03-15 12:40:13 · 857 阅读 · 0 评论 -
leetcode算法-Best Time to Buy and Sell Stock IV
leetcode算法-Best Time to Buy and Sell Stock IV题目:给定一个数组prices[n],其中prices[i]代表第i天股票的价格,限定最多进行k次交易(买进和卖出股票算一次交易),在卖出之前必须进行买入操作,求股票交易的最大收益。涉及算法:动态规划主要思路:(主要是看了大佬的加上自己的理解)我们需要一个数组dp[k+1][prices.length]来记录...原创 2018-03-24 17:59:32 · 143 阅读 · 0 评论 -
滑动窗口问题
博客参考https://www.cnblogs.com/grandyang/p/4340948.htmlleetcode--Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in co...原创 2019-06-18 15:01:53 · 449 阅读 · 0 评论