Minimizing water collection distance in Geek’s village
Geek’s village is represented by a 2-D matrix of characters of size n*m, whereH – Represents a houseW – Represents a well. – Represents an open groundN – Prohibited area(Not allowed to enter this area)Every house in the village needs to take the water from the well, as the family members are so busy with their work, so every family wants to take the water from the well in minimum time, which is possible only if they have to cover as less distance as possible. Your task is to determine the minimum distance that a person in…