Computer Science, asked by dneeraj6703, 10 months ago

You are given an array (zero indexed) of n non-negative integers, a0, a1 ,, an-1. Find the minimum sub array al, al+1 ,, ar so if we sort(in ascending order) that sub array, then the whole array should get sorted. If a is already sorted, output -1.

Answers

Answered by Anonymous
0

You have to find the smallest positive number missing from the array in O(n) time ... non-positive (0 and negative) numbers on left ... int findMissingPositive

Similar questions