31. First Missing Positive
Return the smallest positive integer missing from an unsorted array in O(n) time and O(1) extra space.
उदाहरण 1:
इनपुट: nums = [1,2,0] आउटपुट: 3
उदाहरण 2:
इनपुट: nums = [3,4,-1,1] आउटपुट: 2
सीमाएँ:
1 <= nums.length <= 10^5
Return the smallest positive integer missing from an unsorted array in O(n) time and O(1) extra space.
इनपुट: nums = [1,2,0] आउटपुट: 3
इनपुट: nums = [3,4,-1,1] आउटपुट: 2
1 <= nums.length <= 10^5