Practice Maximum Value Sum by Placing Three Rooks II
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Maximum Value Sum by Placing Three Rooks II
Problem Statement
You are given a m x n 2D array board representing a chessboard, where board[i][j] represents the value of the cell (i, j). Rooks in the same row or column attack each other. You need to place three rooks on the chessboard such that the rooks do not attack each other. Return the maximum sum of the cell values on which the rooks are placed.
Source: Maximum Value Sum by Placing Three Rooks II on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
board = [[-3,1,1,1],[-3,1,-3,1],[-3,2,1,1]]
4
# Example 2
board = [[1,2,3],[4,5,6],[7,8,9]]
15
# Example 3
board = [[1,1,1],[1,1,1],[1,1,1]]
3
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Value Sum by Placing Three Rooks II.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.