Wrong answer on test case 1

hey i m getting one test case as wrong answer , other 3 passed can you tell me for which tc it is failing.?

Hi @Aparna,
consider a test case like n=5, list={ 2,1,3,1,5}
here output should be 1,1,3,1,5 but ur code will give output as 1,1,3,1,3.
Try to modify for code.
If u still any doubts,feel free to post them here.
Hope dis will help.