Practice Maximum Amount of Money Robot Can Earn
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
A robot moves only right or down from the top-left to the bottom-right cell of coins. A nonnegative cell adds its value to the profit; a negative cell subtracts its absolute value. The robot may neutralize the loss at at most two negative cells along the path. Return the maximum possible final profit, which may be negative.
Source: Maximum Amount of Money Robot Can Earn on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
coins = [[0,1,-1],[1,-2,3],[2,-3,4]]
8
# Example 2
coins = [[10,10,10],[10,10,10]]
40
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Amount of Money Robot Can Earn.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.