Search
⌘K

Leetcode 2500. Delete Greatest Value in Each Row

Given an m×n matrix, repeatedly remove the greatest element from each row and add the maximum of those removed elements to a running total until no columns remain; return the final sum. Observing that sorting each row lets you compute the answer by summing column-wise maxima across the sorted rows yields an efficient solution.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.