Maximize Robot's Coins in Grid with Robbers

LeetCode POTD 💫: Description: You are given an m x n grid. A robot starts at the top-left corner of the grid (0, 0) and wants to reach the bottom-right corner (m - 1, n - 1). The robot can move either right or down at any point in time. The grid contains a value coins[i][j] in each cell: -> If coins[i][j] >= 0, the robot gains that many coins. -> If coins[i][j] < 0, the robot encounters a robber, and the robber steals the absolute value of coins[i][j] coins. The robot has a special ability to neutralize robbers in at most 2 cells on its path, preventing them from stealing coins in those cells. Note: The robot's total coins can be negative. Return the maximum profit the robot can gain on the route. Here's my solution: https://lnkd.in/gQVFQaPD #Python #DSA #Leetcode #DailyChallenge #DP

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories