Binary Array Range Queries to find the minimum distance between two Zeros
Prerequisite: Segment TreesGiven a binary array arr[] consisting of only 0's and 1's and a 2D array Q[][] consisting of K queries, the task is to find the minimum distance between two 0's in the range [L, R] of the array for every query {L, R}. Examples: Input: arr[] = {1, 0, 0, 1}, Q[][] = {{0, 2}}