![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 84
SquirrelYuyu
这个作者很懒,什么都没留下…
展开
-
LeetCode #46 Permutations
(Week 1 算法作业)题目:https://leetcode.com/problems/permutations/description/Given a collection of distinct integers, return all possible permutations.Difficulty: MediumExample:Input: [1,2,3]Ou...原创 2018-09-09 22:58:14 · 231 阅读 · 0 评论 -
LeetCode #316 Remove Duplicate Letters
文章目录题目分析贪心算法(Week 9 算法博客)题目Remove Duplicate LettersGiven a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure...原创 2018-11-16 21:11:16 · 637 阅读 · 1 评论 -
LeetCode #153 Candy
LeetCode # 153 Candy文章目录LeetCode # 153 Candy题目分析算法1. 暴力算法2. 一个数组,两次遍历3. 算法2的变种:贪心算法(Week 8 算法博客)题目There are N children standing in a line. Each child is assigned a rating value.You are giving can...原创 2018-11-10 11:52:43 · 310 阅读 · 0 评论 -
LeetCode #854 K-Similar Strings
文章目录题目分析题目K-Similar StringsStrings A and B are K-similar (for some non-negative integer K) if we can swap the positions of two letters in A exactly K times so that the resulting string equals B.Gi...原创 2018-11-10 11:48:00 · 514 阅读 · 0 评论 -
LeetCode #57 Insert Interval
文章目录题目分析结语(Week 6 算法博客)Insert Interval题目Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially so...原创 2018-10-20 01:57:38 · 168 阅读 · 0 评论 -
LeetCode #862 Shortest Subarray with Sum at Least K
文章目录题目分析过程暴力求解寻找优化由end寻找begin结语题目Shortest Subarray with Sum at Least KReturn the length of the shortest, non-empty, contiguous subarray of A with sum at least K.If there is no non-empty subarray w...原创 2018-10-08 10:04:15 · 629 阅读 · 2 评论 -
LeetCode #126 Word Ladder II
文章目录题目分析构建两端之间的最短路径图记录所有路径歧路:节点分裂正途:不删除边的DFS算法递归实现循环&栈实现测试代码(第四周算法博客)因为国庆假和调课,直到现在本人才把上一周的算法博客发出来。不过我在这道题上也走了不少弯路,只能说自己的思维确实还需要锻炼。这篇博客详细地描述了我的思路过程,当是一个记录,也希望它能提醒我以后进行更为全面高效的思考。下面来看看题目:题目Word...原创 2018-10-03 17:11:00 · 259 阅读 · 0 评论 -
LeetCode #41 First Missing Positive
(Week 2 算法作业)题目:分析:算法1算法2题目:First Missing PositiveGiven an unsorted integer array, find the smallest missing positive integer.Example 1:Input: [1,2,0]Output: 3Example 2:...原创 2018-09-15 14:25:23 · 184 阅读 · 0 评论 -
LeetCode #149 Max Points on a Line
(Week 3 算法作业)文章目录题目分析12ms算法其他优秀算法8ms算法sample①sample②4ms算法sample①sample②结语题目Max Points on a LineGiven n points on a 2D plane, find the maximum number of points that lie on the same straight line.E...原创 2018-09-23 20:23:17 · 190 阅读 · 0 评论 -
LeetCode #23 Merge k Sorted Lists
(Week 1 作业)题目:https://leetcode.com/problems/merge-k-sorted-lists/description/Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Difficulty: Har...原创 2018-09-09 23:32:38 · 155 阅读 · 0 评论 -
LeetCode #85 Maximal Rectangle
文章目录题目分析算法1算法2(Week 10 算法博客)题目Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area.Example:Input:[ ["1","0","1&原创 2018-11-17 21:05:35 · 245 阅读 · 0 评论