
LeetCode重点题
肖冬禹想要拿OFFER
人生已如此悲惨,只求能去湾区养老。。。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode重点题系列之【3. Longest Substring Without Repeating Characters】
Given a string, find the length of thelongest substringwithout repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:...原创 2019-04-04 09:06:49 · 162 阅读 · 0 评论 -
LeetCode重点题系列之【26. Remove Duplicates from Sorted Array】
Given a sorted arraynums, remove the duplicatesin-placesuch that each element appear onlyonceand return the new length.Do not allocate extra space for another array, you must do this bymodifyin...原创 2019-04-06 12:20:31 · 228 阅读 · 0 评论 -
LeetCode重点题系列之【10. Regular Expression Matching】
Given an input string (s) and a pattern (p), implement regular expression matching with support for'.'and'*'.'.' Matches any single character.'*' Matches zero or more of the preceding element....原创 2019-04-07 00:31:33 · 263 阅读 · 0 评论 -
LeetCode重点题系列之【12. Integer to Roman】
Roman numerals are represented by seven different symbols:I,V,X,L,C,DandM.Symbol ValueI 1V 5X 10L 50C 100D ...原创 2019-04-07 08:34:37 · 230 阅读 · 0 评论 -
LeetCode重点题系列之【28. Implement strStr()】
ImplementstrStr().Return the index of the first occurrence of needle in haystack, or-1if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Example...原创 2019-04-08 11:48:26 · 217 阅读 · 0 评论 -
LeetCode重点题系列之【583. Delete Operation for Two Strings】
Given two wordsword1andword2, find the minimum number of steps required to makeword1andword2the same, where in each step you can delete one character in either string.Example 1:Input: "sea...原创 2019-04-08 13:25:18 · 462 阅读 · 0 评论 -
LeetCode重点题系列之【32. Longest Valid Parentheses】
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: "(()"Output: 2Explanation: The longest valid...原创 2019-04-09 06:27:31 · 255 阅读 · 0 评论 -
LeetCode重点题系列之【33. Search in Rotated Sorted Array】
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e.,[0,1,2,4,5,6,7]might become[4,5,6,7,0,1,2]).You are given a target value to search. If found ...原创 2019-04-09 07:17:26 · 223 阅读 · 0 评论 -
LeetCode重点题系列之【一. Two Sum】
LeetCode刷了也有350题了,觉得再刷新题没有必要了,开一个新的系列,LeetCode重点题精刷。Given an array of integers, returnindicesof the two numbers such that they add up to a specific target.You may assume that each input would ha...原创 2019-04-03 11:51:36 · 229 阅读 · 0 评论 -
LeetCode重点题系列之【20. Valid Parentheses】
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[ 1->4->5, 1->3->4, 2->6]Output: 1->1->2->3->4-...原创 2019-04-06 08:12:20 · 244 阅读 · 0 评论 -
LeetCode重点题系列之【22.Generate Parentheses】
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())"...原创 2019-04-06 07:06:23 · 233 阅读 · 0 评论 -
LeetCode重点题系列之【5. Longest Palindromic Substring】
Given a strings, find the longest palindromic substring ins. You may assume that the maximum length ofsis 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Exa...原创 2019-04-04 14:18:08 · 218 阅读 · 0 评论 -
LeetCode重点题系列之【4. Median of Two Sorted Arrays】
There are two sorted arraysnums1andnums2of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assumenums1andn...原创 2019-04-05 06:43:38 · 212 阅读 · 0 评论 -
LeetCode重点题系列之【11. Container With Most Water】
Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of lineiis at (i,ai) and (i, 0). Find two...原创 2019-04-05 07:27:21 · 331 阅读 · 0 评论 -
LeetCode重点题系列之【42. Trapping Rain Water】
Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.The above elevation map is represented by array...原创 2019-04-05 08:05:52 · 337 阅读 · 0 评论 -
LeetCode重点题系列之【15. 3Sum】
Given an arraynumsofnintegers, are there elementsa,b,cinnumssuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not conta...原创 2019-04-05 12:52:14 · 238 阅读 · 0 评论 -
LeetCode重点题系列之【17. Letter Combinations of a Phone Number】
Given a string containing digits from2-9inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is giv...原创 2019-04-05 13:41:51 · 299 阅读 · 0 评论 -
LeetCode重点题系列之【53. Maximum Subarray】
Given an integer arraynums, find the contiguous subarray(containing at least one number) which has the largest sum and return its sum.Example:Input: [-2,1,-3,4,-1,2,1,-5,4],Output: 6Explanati...原创 2019-04-10 12:40:28 · 259 阅读 · 0 评论 -
LeetCode重点题系列之【20. Valid Parentheses】
Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of b...原创 2019-04-06 00:31:06 · 313 阅读 · 0 评论 -
LeetCode重点题系列之【75. Sort Colors】
Given an array withnobjects colored red, white or blue, sort themin-placeso that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we will use the in...原创 2019-04-13 08:14:52 · 272 阅读 · 0 评论