摘要: Problem: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant d 阅读全文
posted @ 2017-01-01 08:29 SillyVicky 阅读(177) 评论(0) 推荐(0)
摘要: Problem: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space 阅读全文
posted @ 2016-12-31 13:42 SillyVicky 阅读(122) 评论(0) 推荐(0)
摘要: Problem: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another ar 阅读全文
posted @ 2016-12-30 11:35 SillyVicky 阅读(73) 评论(0) 推荐(0)
摘要: Problem: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra 阅读全文
posted @ 2016-12-30 11:11 SillyVicky 阅读(121) 评论(0) 推荐(0)
摘要: Problem: Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements o 阅读全文
posted @ 2016-12-30 09:20 SillyVicky 阅读(1585) 评论(0) 推荐(0)
摘要: Problem: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] 阅读全文
posted @ 2016-12-29 11:26 SillyVicky 阅读(137) 评论(0) 推荐(0)
摘要: Problem: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return Summary: 输出杨辉三角的前n行。 Solution: 方法类似于Lee 阅读全文
posted @ 2016-12-29 01:24 SillyVicky 阅读(162) 评论(0) 推荐(0)
摘要: Problem: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Note:Could you optimize your algori 阅读全文
posted @ 2016-12-28 12:19 SillyVicky 阅读(178) 评论(0) 推荐(0)
摘要: Problem: Given 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 woul 阅读全文
posted @ 2016-12-28 09:18 SillyVicky 阅读(120) 评论(0) 推荐(0)
摘要: Problem: Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time 阅读全文
posted @ 2016-12-28 09:08 SillyVicky 阅读(169) 评论(0) 推荐(0)