Advanture to Count Max Moves

Problem Overview

  • Compute the maximum number of cells a robot can visit safely before any laser hits it.
  • Input: numRows, numColumns, laserCoordinates [(r,c)], start (curRow, curColumn). Output: max safe cells/moves.
  • Robot moves up, down, left, or right; starting cell is safe; any cell in a laser’s row or column is unsafe.
  • Grid navigation context with lasers acting as sentinels along rows/columns.
  • Databricks coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: