Minimizing water collection distance in Geek’s village – GeeksforGeeks
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…