When the array is 1 1 1 1 1 The expected answer is 0 1 2 3 However the actual ans


#1

When the array is 1 1 1 1 1
The expected answer is 0 1 2 3
However the actual answer should be 0 1 1 2
Because, it is not stated in the problem statement that all the integers should be distinct.
It is given that A<C , A<B , C<D … but there is no constrain upon B!= C .
So why cannot B be equal to C??
Admin please clarify.


#2

You can not take same value for both the pair. In 0 1 1 2 , index 1 position is repeated while 0,1,2,3 all the index position is unique.