- 博客(32)
- 收藏
- 关注
原创 LeetCode_Medium_22. Generate Parentheses
2019.1.31题目描述:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(...
2019-01-31 09:42:37 144
原创 LeetCode_Medium_19. Remove Nth Node From End of List
2019.1.30题目描述:Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second no...
2019-01-30 09:30:53 92
原创 LeetCode_Medium_18. 4Sum
2019.1.29题目描述:Given 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 gi...
2019-01-29 10:06:41 88
原创 LeetCode_Medium_17. Letter Combinations of a Phone Number
2019.1.28Given 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-28 09:49:15 124
原创 LeetCode_Medium_16. 3Sum Closest
2019.1.27题目描述:Given 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...
2019-01-27 11:08:01 89
原创 LeetCode_Medium_15. 3Sum
2019.1.26题目描述:Given 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...
2019-01-26 12:05:50 88
原创 LeetCode_Medium_12. Integer to Roman
2019.1.26题目描述:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C ...
2019-01-26 09:54:08 106
原创 LeetCode_Medium_11. Container With Most Water
2019.1.25题目描述:Given 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) an...
2019-01-25 09:58:34 131
原创 LeetCode_Medium_8. String to Integer (atoi)
2019.1.24题目描述:Implement 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,...
2019-01-24 10:23:22 126
原创 LeetCode_Medium_6. ZigZag Conversion
2019.1.23题目描述:The 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)P A ...
2019-01-23 11:08:03 126
原创 LeetCode_Medium_5. Longest Palindromic Substring
2019.1.22题目描述:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: "babad"Output: "bab"Note: "aba" is also a v...
2019-01-22 10:23:42 99
原创 LeetCode_Medium_3. Longest Substring Without Repeating Characters
2019.1.21题目描述:Given a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of...
2019-01-21 10:55:23 76
原创 LeetCode_Medium_2. Add Two Numbers
2019.1.20计划有变,仍旧以Simple—>Medium—>Hard的方式循环,但决定以每100题的量来循环,所以今天开始做Medium题,这样就不至于总是做Simple题而没什么进步了。好了,废话不多说,开始吧~题目描述:You are given two non-empty linked lists representing two non-negative in...
2019-01-20 11:08:05 108
原创 LeetCode_Simple_100. Same Tree
2019.1.20题目描述:Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the sam...
2019-01-20 10:03:00 70
原创 LeetCode_Simple_88. Merge Sorted Array
2019.1.19题目描述:Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 and nums2 are m and n respectively. ...
2019-01-19 12:09:21 64
原创 LeetCode_Simple_83. Remove Duplicates from Sorted List
2019.1.19题目描述:Given a sorted linked list, delete all duplicates such that each element appear only once.Example 1:Input: 1->1->2Output: 1->2Example 2:Input: 1->1->2->...
2019-01-19 11:07:46 80
原创 LeetCode_Simple_70. Climbing Stairs
2019.1.18题目描述:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n ...
2019-01-18 13:41:48 104
原创 LeetCode_Simple_69. Sqrt(x)
2019.1.18题目描述:Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are ...
2019-01-18 12:28:11 196 1
原创 LeetCode_Simple_67. Add Binary
2019.1.17题目描述:Given two binary strings, return their sum (also a binary string).The input strings are both non-empty and contains only characters 1 or 0.Example 1:Input: a = "11", b = "1"O...
2019-01-17 17:28:44 131
原创 LeetCode_Simple_66.Plus One
2019.1.17题目描述:Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list...
2019-01-17 16:19:14 108
原创 LeetCode_Simple_58. Length of Last Word
2019.1.16题目描述:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Not...
2019-01-16 17:34:32 73
原创 LeetCode_Simple_53. Maximum Subarray
2019.1.16题目描述:Given an integer array nums, 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],O...
2019-01-16 12:37:52 93
原创 LeetCode_Simple_38. Count and Say
2019.1.15题目描述:The count-and-say sequence is the sequence of integers with the first five terms as following:1. 12. 113. 214. 12115. 1112211 is read off as "one 1" or ...
2019-01-15 20:02:47 83
原创 LeetCode_Simple_35. Search Insert Position
2019.1.15题目描述:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicat...
2019-01-15 18:40:19 118
原创 LeetCode_Simple_28. Implement strStr()
2019.1.14题目描述:Implement strStr().Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"O...
2019-01-14 20:17:33 98
原创 LeetCode_Simple_27. Remove Element
2019.1.14题目描述:Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modify...
2019-01-14 19:18:11 76
原创 LeetCode_Simple_20. Valid Parentheses
2019.1.13题目描述: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 ...
2019-01-13 21:21:02 72
原创 LeetCode_Simple_14. Longest Common Prefix
2019.1.13题目描述:Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string "".Example 1:Input: ["flower","flow"...
2019-01-13 20:49:22 127
原创 LeetCode_Simple_13. Roman to Integer
2019.1.12题目描述:Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C ...
2019-01-12 20:33:39 77
原创 LeetCode_Simple_9. Palindrome Number
2019.1.12前几天家里有点事耽搁了,今天继续刷刷刷!题目描述:Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExa...
2019-01-12 19:50:40 128
原创 LeetCode_Simple_7. Reverse Integer
2019.1.8题目描述:Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:...
2019-01-08 21:24:50 80
原创 LeetCode_Simple_1.Two Sum
2019.1.8这道题是LeetCode第一题,是说最经典的也不为过,当然也正式开启了我在LeetCode上的征程,不知道自己能坚持多久,只是希望自己能一直踏实的学习进步,保持对编程的热爱之情,戒骄戒躁,朝着目标不断前进!初步计划:(没有特殊情况下)Simple题,每天两题;Medium题,每天一题;Hard题,每天一题(不知道能不能坚持到hard...Orz)不追求速度,争取把每...
2019-01-08 21:01:41 217 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人