Maximum distance between two elements with value 0 in a subarray
Given a binary array consisting of only 0s and 1s, find the maximum distance between two elements with value 0 in a subarray {l,r}. Examples: Input : arr = {1,0,0,1}, l=0, r=3 Output : 1 Clearly, in the range from 0 to 3, first 0 lies at index 1 and last at index 2. Hence, the distance 2-1… Read More »
