WA in the problem HRDSEQ (Nov. Long Challenge)

Problem Link-https://www.codechef.com/NOV19B/problems/HRDSEQ
Can anyone tell me why i got WA due to line 30 in the for loop.
I only replaced n with v.size() [which is the size of the vector] .n and v.size() are same.(Focus on line 30)

AC solution vs WA solution
AC solution - https://www.codechef.com/viewsolution/27805952 vs WA solution- https://www.codechef.com/viewsolution/27805843

Not for the testcase:

1
1

(at line 30, n=1 , but v.size()=2).

1 Like

@ssjgz,Thanks for the testcase i was looking for.

1 Like