![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
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 · 160 阅读 · 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 · 167 阅读 · 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 · 174 阅读 · 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 · 179 阅读 · 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 · 197 阅读 · 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 · 178 阅读 · 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 · 147 阅读 · 0 评论