上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 27 下一页
摘要: 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 @ 2017-09-07 06:02 Jimmy_Cheng 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
posted @ 2017-09-07 05:19 Jimmy_Cheng 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't 阅读全文
posted @ 2017-09-05 11:00 Jimmy_Cheng 阅读(391) 评论(0) 推荐(0) 编辑
摘要: Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Not 阅读全文
posted @ 2017-09-05 03:55 Jimmy_Cheng 阅读(4245) 评论(0) 推荐(0) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2017-09-03 10:33 Jimmy_Cheng 阅读(234) 评论(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 @ 2017-09-02 10:28 Jimmy_Cheng 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges. For example, given [0, 阅读全文
posted @ 2017-09-02 07:37 Jimmy_Cheng 阅读(703) 评论(0) 推荐(0) 编辑
摘要: A peak element is an element that is greater than its neighbors. Given an input array where num[i] ≠ num[i+1], find a peak element and return its inde 阅读全文
posted @ 2017-09-01 07:13 Jimmy_Cheng 阅读(312) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Find 阅读全文
posted @ 2017-08-31 06:00 Jimmy_Cheng 阅读(296) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4],t 阅读全文
posted @ 2017-08-29 11:30 Jimmy_Cheng 阅读(171) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 27 下一页