![](https://img-blog.csdnimg.cn/20190124222144296.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
leetcode
记录leetcode的刷题经历
yoyooyooo
这个作者很懒,什么都没留下…
展开
-
#21 Merge Two Sorted Lists
DescriptionMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.ExamplesInput: 1->2->4, 1->3->4...原创 2019-01-29 13:22:03 · 132 阅读 · 0 评论 -
#20 Valid Parentheses
DescriptionGiven 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...原创 2019-01-29 12:57:44 · 85 阅读 · 0 评论 -
#19 Remove Nth Node From End of List
DescriptionGiven a linked list, remove the n-th node from the end of list and return its head.ExampleGiven linked list: 1->2->3->4->5, and n = 2.Output: 1->2->3->5.解题思路最常见...原创 2019-01-24 22:11:20 · 127 阅读 · 0 评论 -
#18 4Sum
DescriptionGiven an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives th...原创 2019-01-24 21:22:07 · 129 阅读 · 0 评论 -
#17 Letter Combinations of a Phone Number
DescriptionGiven a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone butt...原创 2019-01-23 23:24:35 · 167 阅读 · 0 评论 -
#16 3Sum Closest
DescriptionGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each ...原创 2019-01-23 22:23:42 · 91 阅读 · 0 评论 -
#15 3Sum
DescriptionGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set mus...原创 2019-01-22 23:59:05 · 93 阅读 · 0 评论 -
#14 Longest Common Prefix
DescriptionWrite a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”ExamplesExample 1:Input: [“flower”,“flow”,...原创 2019-01-21 23:46:30 · 83 阅读 · 0 评论 -
#13 Roman to Integer
DescriptionRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI  原创 2019-01-21 19:17:25 · 93 阅读 · 0 评论 -
#12 Integer to Roman
DescriptionRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI  原创 2019-01-21 10:33:58 · 115 阅读 · 0 评论 -
#11 Container With Most Water
DescriptionGiven n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0)...原创 2019-01-20 23:57:22 · 105 阅读 · 0 评论 -
#9 Palindrome Number
DescriptionDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.ExamplesExample 1:Input: 121Output: trueExample 2:Input: -121O...原创 2018-12-06 22:41:16 · 96 阅读 · 0 评论 -
#8 String to Integer (atoi)
DescriptionImplement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starti...原创 2018-12-06 21:24:47 · 93 阅读 · 0 评论 -
#2 Add Two Numbers
DescriptionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers ...原创 2018-12-01 01:07:36 · 109 阅读 · 0 评论 -
#3 Longest Substring without Repeating Characters
DescriptionGiven a string, find the length of the longest substring without repeating characters.ExamplesExample1:Input: “abcabcbb”Output: 3Explanation: The answer is “abc”, with the length of ...原创 2018-12-02 01:14:48 · 190 阅读 · 1 评论 -
#4 Median of Two Sorted Arrays
DescriptionThere are two sorted arrays nums1 and nums2 of 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 assume n...原创 2018-12-03 01:04:17 · 94 阅读 · 0 评论 -
#5 Longest Palindromic Substring
DescriptionGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.ExamplesExample1Input: “babad”Output: “bab”Note: “aba” is also a va...原创 2018-12-04 00:16:01 · 85 阅读 · 0 评论 -
#6 ZigZag Conversion
DescriptionThe string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)And then read ...原创 2018-12-04 21:41:03 · 196 阅读 · 0 评论 -
#7 Reverse Integer
DescriptionGiven a 32-bit signed integer, reverse digits of an integer.Note:Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [−231, ...原创 2018-12-05 22:50:55 · 97 阅读 · 0 评论 -
#1 Two-sum
DescriptionGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not us...原创 2018-11-30 01:17:44 · 131 阅读 · 0 评论