Constraints should be: 1 <= N <= 2 000 000


#1

check whether N is equal to 1 or not;


#2

No, since in the question its mentioned that atleast 1 number appears twice.
Let me know if you understood the same?