- 博客(15)
- 收藏
- 关注
原创 leetcode python maximum-subarray
加油Maximum-subarray题意思路python实现Maximum-subarray题意在古老的一维模式识别中,常常需要计算连续子向量的最大和,当向量全为正数的时候,问题很好解决。但是,如果向量中包含负数,是否应该包含某个负数,并期望旁边的正数会弥补它呢?例如:{6,-3,-2,7,-15,1,2,2},连续子向量的最大和为8(从第0个开始,到第3个为止)。思路必须要有变量记...
2019-06-11 16:07:44
140
原创 leetcode python unique-paths(包含12)
机器人走路二题unique-paths(后面还有ii)题意思路python实现unique-paths-ii题意思路python实现unique-paths(后面还有ii)A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can o...
2019-06-11 15:55:17
128
原创 leetcode python Edit Distance
三点半Minimum Path Sum题意思路python实现Minimum Path SumGiven a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizesthe sum of all numbers along its path.N...
2019-06-11 15:42:22
122
原创 leetcode python Minimum Path Sum
慌慌的Edit Distance题意思路python实现Edit DistanceGiven two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation iscounted as 1 step.)You have the fol...
2019-06-11 15:09:58
105
原创 leetcode python minimum-window-substring
准备次饭minimum-window-substring题意思路python实现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 complexity O(n).For examp...
2019-06-11 11:46:26
182
原创 leetcode python decode-ways
刚开完会decode-ways题意思路python实现decode-waysA message containing letters from A-Z is being encoded to numbers using the following mapping:‘A’ -> 1‘B’ -> 2…‘Z’ -> 26Given an encoded message c...
2019-06-11 10:18:09
108
原创 leetcode python interleaving-string
准备下班interleaving-string题意思路python实现interleaving-stringGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 =“aabcc”,s2 =“dbbca”,When s3 = “aadbbcbca...
2019-06-10 20:34:15
161
原创 leetcode python best-time-to-buy-and-sell-stock(包含123)
股票三题best-time-to-buy-and-sell-stock(后面还有ii和iii)题意思路python实现best-time-to-buy-and-sell-stock ii题意思路python实现best-time-to-buy-and-sell-stock iii题意思路python实现best-time-to-buy-and-sell-stock(后面还有ii和iii)Say...
2019-06-10 16:10:21
182
原创 leetcode python palindrome-partitioning-ii
心有困扰palindrome-partitioning-ii题意思路python实现palindrome-partitioning-iiGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a pal...
2019-06-10 14:59:49
153
原创 leetcode python Gas Station
注意效率Gas Station题意思路python实现Gas StationThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costscost[i] o...
2019-06-10 14:27:15
158
原创 leetcode python candy
按时睡觉candy题意思路暴力dfs python实现candyThere are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each...
2019-06-10 11:39:31
181
原创 leetcode python word-break-ii
第一篇博客word-break-ii题意思路暴力dfs python实现dp+dfs python实现word-break-iiGiven a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.R...
2019-06-10 10:36:24
172
2
原创 leetcode python word-break
第一篇博客word-break题意思路python实现word-breakGiven a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, gi...
2019-06-06 20:24:12
171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人