array
文章平均质量分 76
mynotwo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
41. First Missing Positive
Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your algorithm should run in O(n) time and uses constant原创 2017-06-12 19:18:51 · 200 阅读 · 0 评论 -
120. Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given the following triangle [ [2], [3,4], [6,原创 2016-12-18 19:48:53 · 201 阅读 · 0 评论 -
532. K-diff Pairs in an Array
Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers原创 2017-06-12 19:23:57 · 215 阅读 · 0 评论 -
565. Array Nesting
A zero-indexed array A consisting of N different integers is given. The array contains all integers in the range [0, N - 1]. Sets S[K] for 0 S[K] = { A[K], A[A[K]], A[A[A[K]]], ... }. Sets S原创 2017-06-12 19:29:18 · 222 阅读 · 0 评论 -
581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array will be sorted in ascending order, too. You need to fin原创 2017-06-12 19:35:03 · 236 阅读 · 0 评论 -
169.Majority Element && 229. Majority Element II
Majority Element 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 array is non-empty and the原创 2016-05-13 11:52:44 · 214 阅读 · 0 评论 -
26. Remove Duplicates from Sorted Array&&27. Remove Element
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 space for another array, you must do this in place with原创 2016-05-23 15:53:31 · 183 阅读 · 0 评论
分享