
leetcode
pipiang
这个作者很懒,什么都没留下…
展开
-
leetcode1,7,9,14,20
Two SumGiven 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 use the...原创 2018-04-22 23:29:17 · 137 阅读 · 0 评论 -
leetcode 70,83
70. Climbing StairsExample 2:Input: 3Output: 3Explanation: There are three ways to climb to the top.1. 1 step + 1 step + 1 step2. 1 step + 2 steps3. 2 steps + 1 step斐波那契数列方法一备忘录算法 int[] map = ne...原创 2018-04-28 11:47:19 · 131 阅读 · 0 评论 -
leetcode 125,136,141,155
125. Valid PalindromeGiven a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.Note: For the purpose of this problem, we define empty string as valid...原创 2018-05-05 17:14:45 · 168 阅读 · 0 评论 -
leetcode66,67
66. Plus OneGiven 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, and ea...原创 2018-04-27 10:07:44 · 507 阅读 · 0 评论 -
leetcode 121,122
121. Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (i.e., buy one...原创 2018-05-04 21:52:33 · 475 阅读 · 0 评论 -
leetcode 53,58
53. Maximum SubarrayGiven 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],Outp...原创 2018-04-26 10:17:08 · 155 阅读 · 0 评论 -
leetcode 110,111,112,118,119
110. Balanced Binary TreeGiven a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of e...原创 2018-05-03 11:51:22 · 246 阅读 · 0 评论 -
leetcode 35,38
35. Search Insert PositionGiven 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 du...原创 2018-04-25 10:27:59 · 176 阅读 · 0 评论 -
leetcode 27,28
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 modifying the input array ...原创 2018-04-24 10:17:29 · 137 阅读 · 0 评论 -
leetcode 101,104,107,108
101. Symmetric TreeGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / ...原创 2018-05-01 11:19:33 · 318 阅读 · 0 评论 -
leetcode 88,100
88. Merge Sorted ArrayGiven 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.Yo...原创 2018-04-30 09:16:48 · 179 阅读 · 0 评论 -
leetcode 21,26
Merge Two Sorted ListsMerge 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.Example:Input: 1->2->4, 1->...原创 2018-04-23 14:04:14 · 143 阅读 · 0 评论 -
leetcode: Array标签题整理
2. Add Two NumbersYou 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 nu...原创 2018-06-30 12:50:30 · 495 阅读 · 0 评论