getting wa : lights

i have tried for many test cases my code gives correct answer but on submitting it gives WA

my code: CodeChef: Practical coding for everyone

problem link: LIGHTS Problem - CodeChef

THANKS IN ADVANCE

This is the accepted solution. You have to sort the β€œc” array so that you consider all the elements which are less than (n+1)/2. β€œsort()” is a predefined function in c++. You can read more about it from this link.

1 Like