Question: CodeChef: Practical coding for everyone
My Code: CodeChef: Practical coding for everyone
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.