Question: https://www.codechef.com/LTIME68B/problems/WTCH
My Code: https://www.codechef.com/viewsolution/22644422
My logic was that I surround the 1s of the string with 0s, then consider the subarrays between the "010"s as empty subarrays and then use the result of first subtask i.e. (N-1)/2+1. Answer would be sum of answer of these subarrays.
Please debug this code or tell me a case where it fails.