#3276

Select Cells in Grid With Maximum Score

grandmaster · 2270 · lc hard +32 · 15.6% accepted · 226 likes · top 0%

Description

You are given 2D matrix grid of positive integers. Select one or more cells so no two share a row and all values are distinct. Return the maximum sum of selected cell values.

Code

1
2
3