I have seen many videos and even read editorial of this question. All the solutions are assuming that given array contains numbers from 1 to N (size of array) but it is not mentioned anywhere in the question or may be I am unable to find it.

Can someone pls tell how we can assume that array contains all elements from 1 to N with any frequency of each element.

Here is the link to the question :

https://www.codechef.com/LTIME83B/problems/MEXUM