摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [-2,1,-3,4,-1,2, 阅读全文
posted @ 2018-03-21 20:25 还是说得清点吧 阅读(130) 评论(0) 推荐(0)
摘要: 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 array, you 阅读全文
posted @ 2018-03-20 22:10 还是说得清点吧 阅读(150) 评论(0) 推荐(0)
摘要: In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as 阅读全文
posted @ 2018-03-20 21:54 还是说得清点吧 阅读(135) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray). Example 1: Example 2: Note: Length of th 阅读全文
posted @ 2018-03-20 21:33 还是说得清点吧 阅读(129) 评论(0) 推荐(0)
摘要: On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y 阅读全文
posted @ 2018-03-20 20:56 还是说得清点吧 阅读(87) 评论(0) 推荐(0)
摘要: Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: Note: 这道题还是比较简单的,直接贴代码吧:) 阅读全文
posted @ 2018-03-20 20:21 还是说得清点吧 阅读(119) 评论(0) 推荐(0)
摘要: Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array. Example 1 Example 2 Note:Your al 阅读全文
posted @ 2018-03-20 20:05 还是说得清点吧 阅读(764) 评论(0) 推荐(0)
摘要: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr 阅读全文
posted @ 2018-03-19 21:11 还是说得清点吧 阅读(104) 评论(0) 推荐(0)
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2018-03-19 20:50 还是说得清点吧 阅读(93) 评论(0) 推荐(0)
摘要: 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 would have ex 阅读全文
posted @ 2018-03-19 20:23 还是说得清点吧 阅读(137) 评论(0) 推荐(0)