GoogleSoftware Engineer · OnsiteCodemia practiceCut Trees in Increasing Height Order With the Fewest Steps
A forest grid has 0 for obstacles, 1 for walkable ground, and values above 1 for trees of that height. Starting at (0, 0), you must cut all trees in increasing height order; a cut tree becomes ground. Return the total steps, or -1 if any tree is unreachable.