One test case gone wrong

here is the link to code:

Hi @Ekram,
Sample Input:
5
2
3
4
2
5
Correct Output:
1 2 3 1 5 END
Your Output:
1 2 3 1 2 END

Hope you get the mistake. :slight_smile: