Answer & Explanation:i want a recursive function that takes in a grid (a 2d list) of Xs and an f or two like for example:X X X X X
X X X X X X
F X X X X
X X X X X X
X X X X X
X X X X X X
X X H X X
X X X X X X
X X X X X
X X X X X X
X X X X X
X X X X X X
X X X X X
X X X X X X
X X X X X
X X X X X X
X X
X X X X X X X X X the H is stands for house. the recursive function should check the neighboring locations close around F (north,
south, east, and west) and then the function should change the Xs that neighbor the F to Fs and change the old F to D like this: F
X X
X
X X X
X X X X
D F X
X X X
X X X
X X
F X X
X X X
X X X
X X
X X H
X X X
X X X
X X
X X X
X X X
X X X
X X
X X X
X X X
X X X
X X
X X X
X X X
X X X
X X
X X X
X X X
X X X
X X X
X X X
X X X
X X X XFs can only move one space at a time and i should be able to control howmany times it runs but that doesnt nessarly need to be in the function itselfuse example file as guide
example.txt