The problem is to find the number of empty spots within a distance relative to other houses. Consider an array containing either zero or one. One means the place is occupied by a house and zero means an empty place. Count the number of empty places within a distance R with respect to all houses.