Your solution gives the wrong answer for the following test input:
1
18
1 2 3 4 8 9 11 12 13 14 22 24 29 31 32 33 34 36
There are also index out-of-bounds errors on line 22 for the sample testcase.
2 Likes
thanks a lot!! for always helping
now my solution is correct.
1 Like