Well explained . I too tried a similar idea , but couldn’t got it accepted .
Thanks . Fixed
Could someone explain what is wrong with my code? It passes every test case provided above. Best regards.
https://www.codechef.com/viewsolution/13890268
Nicely explained . Thanks for this. Marking as Accepted
what will be the answer for
1
10
1 2 3 1 4 4 1 3 1 1
according to me it should be 17
'only possible way is 1 2 1