Algorithm · C3.ai · Medium
You are given a square grid in which each cell holds a height value, along with an integer giving the largest upward climb permitted in a single step. Starting in the top-left cell, determine whether it is possible to reach the bottom-right cell. Stepping into a cell whose height is lower is always permitted. Stepping into a cell whose height is greater is permitted only when the increase in height does not exceed the maximum climb value. Return whether the bottom-right cell…