#3402

Minimum Operations to Make Columns Strictly Increasing

easy · 72.6% accepted · 65 likes · top 82%

array · greedy · matrix

⊣ practice⊣ open on leetcode ↗

Description

You are given a m x n matrix grid consisting of non-negative integers.

In one operation, you can increment the value of any grid[i][j] by 1.

Return the minimum number of operations needed to make all columns of grid strictly increasing.

Solution