摘要:
Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should run inO(n) time and uses constant space.找到第一个没有出现的正整数思路:http://tech-wonderland.net/blog/leetcode-first-missing-positive.html就是把出现的正整数a都放在a-1的位置,然后从头开始历遍 阅读全文