NeetCode #119LC-2017MediumArrays & Hashing
← Back to All Problems

#119 · #2017 · Grid Game(网格游戏)

📌 Problem Statement & Constraints

Two robots play on a 2 x n grid. Robot 1 starts at (0, 0) and moves only right; it may drop to row 1 at any column, after which it continues right and cannot return. Robot 2 starts at (1, n-1) and moves only left, also able to switch rows once. Cells collected by robot 1 become zero for robot 2. Robot 1 plays to minimise robot 2's score. Return robot 2's final score. Constraints: 1 <= n <= 5 * 10^4, 0 <= grid[i][j] <= 10^5.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!