I came across this question, could not find optimal solution.
Question :
There are n villages placed in linear fashion which are located 1 distance away from each. We have an array which
represents the water plant feasibility (means you can install a water plant in that village) in the particular
village [1 represent water plant feasibility and 0 represent no water plant feasibility]. A water plant can supply
water to distance K in both directions. Now we have to find the minimum no. of water plants which are required to
transfer water to all villages.