![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode笔记
文章平均质量分 79
Yuxin_Wu
这个作者很懒,什么都没留下…
展开
-
LeetCode 55. Jump Game 跳跃游戏
Question:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine ...原创 2018-04-22 15:28:42 · 817 阅读 · 0 评论 -
LeetCode 3. Longest Substring Without Repeating Characters 无重复字符的最长子串
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the l...原创 2018-05-08 18:12:39 · 167 阅读 · 0 评论 -
LeetCode 49. Group Anagrams 同字符词语分组
Given an array of strings, group anagrams together.Example:Input: ["eat", "tea", "tan", "ate", "nat", "bat"],Output:[ ["ate","eat","tea"], ["nat",&原创 2018-05-08 15:41:15 · 287 阅读 · 0 评论 -
LeetCode 290. Word Pattern 单词匹配
Question:Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.E...原创 2018-05-08 15:05:56 · 306 阅读 · 0 评论 -
LeetCode 409. Longest Palindrome 最长回文字串
Question:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is no...原创 2018-05-08 14:04:32 · 170 阅读 · 0 评论 -
LeetCode 207. Course Schedule 课程安排表
There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: ...原创 2018-05-07 20:27:59 · 340 阅读 · 0 评论 -
LeetCode 402. Remove K Digits 除去K个数,使得结果最小
Question:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Note:The length of num is less than 10002 and will be...原创 2018-04-20 18:31:24 · 327 阅读 · 0 评论 -
LeetCode 76. Minimum Window Substring 最小窗口子串
Given 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).Example:Input: S = "ADOBECODEBANC", T = "ABC"Output: "BANC"Note:If there i...原创 2018-05-08 20:57:44 · 188 阅读 · 0 评论 -
LeetCode 455. Assign Cookies 分饼干
Question:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size...原创 2018-04-19 19:34:53 · 258 阅读 · 0 评论 -
LeetCode 295. Find Median from Data Stream 从数据流中寻找中位数
Question:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.Examples: [2,3,4] , the med...原创 2018-04-19 19:26:57 · 249 阅读 · 0 评论 -
LeetCode.215 Kth Largest Element in an Array 返回数组中第K大的数
Question:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return ...原创 2018-04-19 14:53:20 · 161 阅读 · 0 评论 -
LeetCode 155. Min Stack 返回栈中最小值
Question:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() --...原创 2018-04-19 14:09:47 · 175 阅读 · 0 评论 -
LeetCode 225. Implement Stack using Queues 用队列实现栈
Question:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return...原创 2018-04-19 13:44:08 · 136 阅读 · 0 评论 -
LeetCode 232. Implement Queue using Stacks 用栈实现队列
Question:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.e...原创 2018-04-19 13:33:54 · 255 阅读 · 0 评论 -
LeetCode 376. Wiggle Subsequence 摇摆序列
Question:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be e...原创 2018-04-22 18:21:21 · 382 阅读 · 0 评论 -
LeetCode 452. Minimum Number of Arrows to Burst Balloons 射击气球所需最少弓箭手数量
Question:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, ...原创 2018-04-22 18:12:22 · 406 阅读 · 0 评论 -
LeetCode 45. Jump Game II 跳跃游戏2
Question:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal ...原创 2018-04-22 17:04:50 · 294 阅读 · 0 评论 -
LeetCode 187. Repeated DNA Sequences 重复的DNA序列
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.Write a...原创 2018-05-08 19:44:02 · 791 阅读 · 0 评论