Please correct my code

@Lovishbansal
This test case is giving WA
Q : 4
1 2 2 1
4
A : 1 2 2 1