Initially I could only solve it using a map. But obviously that doesn’t meet the constant space requirement.
Reference:
http://blog.unieagle.net/2012/09/20/leetcode题目:first-missing-positive/
The DIY hash approach is clever.
| |
Initially I could only solve it using a map. But obviously that doesn’t meet the constant space requirement.
Reference:
http://blog.unieagle.net/2012/09/20/leetcode题目:first-missing-positive/
The DIY hash approach is clever.
| |