- 博客(57)
- 收藏
- 关注
原创 【LeetCode】解题44:Wildcard Matching(动态规划解法)
LeetCode解题 44:Wildcard Matching(动态规划解法)Problem 44: Wildcard Matching [Hard]解题思路Solution (Java)Problem 44: Wildcard Matching [Hard]Given an input string (s) and a pattern (p), implement wildcard patt...
2020-04-27 14:52:34
318
原创 【LeetCode】解题32:Longest Valid Parentheses(多解法:栈+动态规划+计数器)
LeetCode解题 32:Longest Valid Parentheses(多解法:栈+动态规划+计数器)Problem 32: Longest Valid Parentheses [Hard]解题思路1. 栈2. 动态规划3. 计数器Solution (Java)Problem 32: Longest Valid Parentheses [Hard]Given a string cont...
2020-04-27 01:00:42
262
原创 【LeetCode】解题10:Regular Expression Matching(动态规划解法)
LeetCode解题 10:Regular Expression Matching(动态规划解法)Problem 10: Regular Expression Matching [Hard]解题思路Solution (Java)Problem 10: Regular Expression Matching [Hard]Given an input string (s) and a patter...
2020-04-25 01:55:07
327
原创 【LeetCode】解题5:Longest Palindromic Substring(多解法:动态规划+中心扩散)
LeetCode解题 152:Longest Palindromic SubstringProblem 152: Longest Palindromic Substring [Medium]解题思路Solution (Java)Problem 152: Longest Palindromic Substring [Medium]Given an integer array nums, find...
2020-04-21 00:19:21
170
原创 【LeetCode】解题152:Maximum Product Subarray
LeetCode解题 152:Maximum Product SubarrayProblem 152: Maximum Product Subarray [Medium]解题思路Solution (Java)Problem 152: Maximum Product Subarray [Medium]Given an integer array nums, find the contiguous...
2020-04-20 00:03:34
168
原创 【LeetCode】解题128:Longest Consecutive Sequence
LeetCode解题 128:Longest Consecutive SequenceProblem 128: Longest Consecutive Sequence [Hard]解题思路Solution (Java)Problem 128: Longest Consecutive Sequence [Hard]Given an unsorted array of integers, fin...
2020-04-19 00:34:27
189
原创 【LeetCode】解题126:Word Ladder II(BFS算法)
LeetCode解题 126:Word Ladder II(BFS算法)Problem 126: Word Ladder II [Hard]解题思路Solution (Java)修改过程Problem 126: Word Ladder II [Hard]Given two words (beginWord and endWord), and a dictionary’s word list, ...
2020-04-18 01:25:00
691
原创 【LeetCode】解题714:Best Time to Buy and Sell Stock with Transaction Fee(动态规划)
LeetCode解题 714:Best Time to Buy and Sell Stock with Transaction Fee (动态规划)Problem 714: Best Time to Buy and Sell Stock with Transaction Fee [Medium]解题思路Solution (Java)Problem 714: Best Time to Buy an...
2020-04-16 17:35:58
256
原创 【LeetCode】解题309:Best Time to Buy and Sell Stock with Cooldown(动态规划)
LeetCode解题 309:Best Time to Buy and Sell Stock with Cooldown (动态规划)Problem 309: Best Time to Buy and Sell Stock with Cooldown [Medium]解题思路Solution (Java)修改过程Problem 309: Best Time to Buy and Sell Sto...
2020-04-16 00:12:34
237
原创 【LeetCode】解题188:Best Time to Buy and Sell Stock IV(动态规划)
LeetCode解题 188:Best Time to Buy and Sell Stock IV (动态规划)Problem 188: Best Time to Buy and Sell Stock IV [Hard]解题思路Solution (Java)修改过程Problem 188: Best Time to Buy and Sell Stock IV [Hard]Say you hav...
2020-04-15 14:44:24
495
原创 【LeetCode】解题123:Best Time to Buy and Sell Stock III(动态规划)
LeetCode解题 123:Best Time to Buy and Sell Stock III (动态规划)Problem 123: Best Time to Buy and Sell Stock III [Hard]解题思路I. O(2n)时间+O(3n)空间II. O(2n)时间+O(n)空间III. O(n)时间+O(4)空间Solution (Java)Problem 123: B...
2020-04-15 02:24:24
390
原创 【LeetCode】解题122:Best Time to Buy and Sell Stock II
LeetCode解题 122:Best Time to Buy and Sell Stock II Problem 122: Best Time to Buy and Sell Stock II [Easy]解题思路Solution (Java)Problem 122: Best Time to Buy and Sell Stock II [Easy]Say you have an array...
2020-04-12 22:35:46
273
原创 【LeetCode】解题121:Best Time to Buy and Sell Stock
LeetCode解题 121:Best Time to Buy and Sell Stock Problem 121: Best Time to Buy and Sell Stock [Easy]解题思路Solution (Java)Problem 121: Best Time to Buy and Sell Stock [Easy]Say you have an array for whic...
2020-04-11 20:39:43
237
原创 【LeetCode】解题120:Triangle
LeetCode解题 120:Triangle Problem 120: Triangle [Medium]解题思路Solution (Java)Problem 120: Triangle [Medium]Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjac...
2020-04-11 02:00:24
201
原创 【LeetCode】解题119:Pascal's Triangle II
LeetCode解题 118:Pascal's Triangle II Problem 118: Pascal's Triangle II [Easy]解题思路Solution (Java)Problem 118: Pascal’s Triangle II [Easy]Given a non-negative index k where k ≤ 33, return the kth index...
2020-04-10 02:06:46
360
原创 【LeetCode】解题118:Pascal's Triangle
LeetCode解题 118:Pascal's Triangle Problem 118: Pascal's Triangle [Easy]解题思路Solution (Java)Problem 118: Pascal’s Triangle [Easy]Given a non-negative integer numRows, generate the first numRows of Pasc...
2020-04-08 23:29:40
207
原创 【LeetCode】解题105:Construct Binary Tree from Preorder and Inorder Traversal
LeetCode解题 105:Construct Binary Tree from Preorder and Inorder Traversal Problem 105: Construct Binary Tree from Preorder and Inorder Traversal [Medium]解题思路Solution (Java)Problem 105: Construct Binar...
2020-04-06 18:47:58
152
原创 【LeetCode】解题90:Subsets II
LeetCode解题 90:Subsets II Problem 90: Subsets II [Medium]解题思路Solution (Java)修改过程Problem 90: Subsets II [Medium]Given a collection of integers that might contain duplicates, nums, return all possible ...
2020-04-05 17:45:48
171
原创 【LeetCode】解题85:Maximal Rectangle
LeetCode解题 85:Maximal Rectangle Problem 85: Maximal Rectangle [Hard]解题思路Solution (Java)Problem 85: Maximal Rectangle [Hard]Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangl...
2020-04-03 20:50:04
183
原创 【LeetCode】解题84:Largest Rectangle in Histogram
LeetCode解题 84:Largest Rectangle in Histogram Problem 84: Largest Rectangle in Histogram [Hard]解题思路1. 分治法2. 栈Solution (Java)修改过程Problem 84: Largest Rectangle in Histogram [Hard]Given n non-negative i...
2020-04-03 02:56:39
227
原创 【LeetCode】解题81:Search in Rotated Sorted Array II
LeetCode解题 81:Search in Rotated Sorted Array II Problem 81: Search in Rotated Sorted Array II [Medium]解题思路Solution (Java)Problem 81: Search in Rotated Sorted Array II [Medium]Suppose an array sorted...
2020-04-01 23:00:39
187
原创 【LeetCode】解题80:Remove Duplicates from Sorted Array II
LeetCode解题 80:Remove Duplicates from Sorted Array II Problem 80: Remove Duplicates from Sorted Array II [Medium]解题思路Solution (Java)修改过程Problem 80: Remove Duplicates from Sorted Array II [Medium]Give...
2020-03-31 21:33:26
267
原创 【LeetCode】解题79:Word Search
LeetCode解题 79:Word Search Problem 79: Word Search [Medium]解题思路Solution (Java)修改过程Problem 79: Word Search [Medium]Given a 2D board and a word, find if the word exists in the grid.The word can be con...
2020-03-31 02:24:05
241
原创 【LeetCode】解题78:Subsets
LeetCode解题 78:Subsets Problem 78: Subsets [Medium]解题思路Solution (Java)修改过程Problem 78: Subsets [Medium]Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The so...
2020-03-29 20:32:40
151
原创 【LeetCode】解题75:Sort Colors
LeetCode解题 75:Sort Colors Problem 75: Sort Colors [Medium]解题思路Solution (Java)修改过程Problem 75: Sort Colors [Medium]Given an array with n objects colored red, white or blue, sort them in-place so that ...
2020-03-29 00:08:04
188
原创 【LeetCode】解题74:Search a 2D Matrix
LeetCode解题 74:Search a 2D Matrix Problem 74: Search a 2D Matrix [Medium]解题思路Solution (Java)Problem 74: Search a 2D Matrix [Medium]Write an efficient algorithm that searches for a value in an m x n m...
2020-03-27 15:15:27
158
原创 成功解决第nnnnnn次couldn't communicate with the NVIDIA driver后的方案总结
解决内核更新到4.15.0-91-generic后与nvidia-418.87.01驱动不匹配问题 环境说明问题可用解决方案1. 不需要重装2. 直接重装驱动尝试后不可解决方案1. 回退内核版本未出现问题众所周知,在Ubuntu上安装CUDA的体验非常之差。(惭愧的是本人没有从零开始装CUDA的体验,但是经常找不到NVIDIA驱动的体验已经够差了。)之前组里的服务器很少出现这个问题,自从开始...
2020-03-26 17:27:57
1070
1
原创 【LeetCode】解题73:Set Matrix Zeroes
LeetCode解题 73:Set Matrix Zeroes Problem 73: Set Matrix Zeroes [Medium]解题思路Solution (Java)Problem 73: Set Matrix Zeroes [Medium]Given a m x n matrix, if an element is 0, set its entire row and column...
2020-03-25 14:39:57
150
原创 【LeetCode】解题66:Plus One
LeetCode解题 66:Plus One Problem 66: Plus One [Easy]解题思路Solution (Java)修改过程Problem 66: Plus One [Easy]Given a non-empty array of digits representing a non-negative integer, plus one to the integer.Th...
2020-03-22 17:12:13
185
原创 【LeetCode】解题64:Minimum Path Sum
LeetCode解题 64:Minimum Path Sum Problem 64: Minimum Path Sum [Medium]解题思路Solution (Java)Problem 64: Minimum Path Sum [Medium]Given a m x n grid filled with non-negative numbers, find a path from top ...
2020-03-21 17:46:13
231
原创 【LeetCode】解题63:Unique Paths II
LeetCode解题 63:Unique Paths II Problem 63: Unique Paths II [Medium]解题思路Solution (Java)Problem 63: Unique Paths II [Medium]A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in ...
2020-03-20 18:27:53
215
原创 【LeetCode】解题62:Unique Paths
LeetCode解题 62:Unique Paths Problem 62: Unique Paths [Medium]解题思路Solution (Java)Problem 62: Unique Paths [Medium]A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagr...
2020-03-20 01:12:34
173
原创 【LeetCode】解题59:Spiral Matrix II
LeetCode解题 59:Spiral Matrix II Problem 59: Spiral Matrix II [Medium]解题思路Solution (Java)Problem 59: Spiral Matrix II [Medium]Given a positive integer n, generate a square matrix filled with elements ...
2020-03-17 14:51:42
177
原创 【LeetCode】解题57:Insert Interval
LeetCode解题 57:Insert Interval Problem 57: Insert Interval [Hard]解题思路Solution (Java)Problem 57: Insert Interval [Hard]Given a set of non-overlapping intervals, insert a new interval into the interval...
2020-03-17 00:33:17
209
原创 【LeetCode】解题56:Merge Intervals
LeetCode解题 56:Merge Intervals Problem 56: Merge Intervals [Medium]解题思路Solution (Java)Problem 56: Merge Intervals [Medium]Given a collection of intervals, merge all overlapping intervals.Example 1:...
2020-03-16 01:02:22
179
原创 【LeetCode】解题55:Jump Game
LeetCode解题 55:Jump Game Problem 55: Jump Game [Medium]解题思路Solution (Java)Problem 55: Jump Game [Medium]Given an array of non-negative integers, you are initially positioned at the first index of the...
2020-03-14 23:43:17
204
1
原创 【LeetCode】解题54:Spiral Matrix
LeetCode解题 54:Spiral Matrix Problem 54: Spiral Matrix [Medium]解题思路Solution (Java)修改过程Problem 54: Spiral Matrix [Medium]Given a matrix of m x n elements (m rows, n columns), return all elements of th...
2020-03-14 01:19:55
173
原创 【LeetCode】解题53:Maximum Subarray
LeetCode解题 53:Maximum Subarray Problem 53: Maximum Subarray [Easy]解题思路Solution (Java)Problem 53: Maximum Subarray [Easy]Given an integer array nums, find the contiguous subarray (containing at least...
2020-03-13 00:25:22
217
原创 【LeetCode】解题48:Rotate Image
LeetCode解题 48:Rotate Image Problem 48: Rotate Image [Medium]解题思路Solution (Java)Problem 48: Rotate Image [Medium]You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees...
2020-03-10 22:47:04
154
原创 【LeetCode】解题45:Jump Game II
LeetCode解题 45:Jump Game II Problem 45: Jump Game II [Hard]解题思路1. 暴力搜索(不剪枝)2. 贪心算法Solution (Java)修改过程Problem 45: Jump Game II [Hard]Given an array of non-negative integers, you are initially position...
2020-03-10 01:38:17
196
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人