上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页
摘要: 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 @ 2016-07-06 17:25 Black_Knight 阅读(164) 评论(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 @ 2016-07-04 23:00 Black_Knight 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 阅读全文
posted @ 2016-07-04 09:19 Black_Knight 阅读(248) 评论(0) 推荐(0) 编辑
摘要: public class Solution { public List> combinationSum3(int k, int n) { return combination(k, n, 1); } public List> combination(int k, int target, int start) { List> lis... 阅读全文
posted @ 2016-06-30 23:33 Black_Knight 阅读(176) 评论(0) 推荐(0) 编辑
摘要: Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space. Hi 阅读全文
posted @ 2016-06-29 23:41 Black_Knight 阅读(225) 评论(0) 推荐(0) 编辑
摘要: According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2016-06-23 09:16 Black_Knight 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Find Minimum in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a 阅读全文
posted @ 2016-06-06 09:16 Black_Knight 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array 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). You are given a target va 阅读全文
posted @ 2016-06-05 17:38 Black_Knight 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array 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 the minimum element. 阅读全文
posted @ 2016-06-03 10:16 Black_Knight 阅读(240) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must 阅读全文
posted @ 2016-06-03 09:26 Black_Knight 阅读(547) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 23 下一页