Minutes until every tree burns
A field is a list of equal-length strings: "F" is a cell on fire, "T" is a tree and "." is bare ground that never burns. Every minute, each burning cell sets fire to the trees directly above, below, left and right of it. Return the number of minutes until every tree is on fire, or -1 if some tree can never burn.
There may be several fires, or none; if the field has no trees (or is empty), the answer is 0.
Besides the tests, one large input (a 50 × 50 forest, 289 fires) with a ~200 ms limit (scaled to your device's speed): brute force won't pass.
Examples
minutes_to_burn(["FTT","TT.",".TT"])→4minutes_to_burn(["F.T","TTT","T.F"])→2minutes_to_burn(["FT.","..T"])→-1