Find the smallest positive number missing from an unsorted array leetcode
Answers
Answered by
0
We can use sorting to solve it in lesser time complexity. We can sort the array in O(nLogn) time. Once the array is sorted, then all we need to do is a linear scan of the array. So this approach takes O(nLogn + n) time which is O(nLogn).
Similar questions