filmov
tv
Leetcode 2371. Minimize Maximum Value in a Grid - reset from positions with smaller values to larger

Показать описание
See other videos @codeyao9796
Python sorting solution to Leetcode 2371- Minimize Maximum Value in a Grid. We take the following 2-steps: 1. sort the positions according to grid value from small to large; 2. set the position in order and use incremental integer values. These two steps will server two purposes: 1. maintain relative order in both row and col; 2. make the vals in grid as small as possible.
Python sorting solution to Leetcode 2371- Minimize Maximum Value in a Grid. We take the following 2-steps: 1. sort the positions according to grid value from small to large; 2. set the position in order and use incremental integer values. These two steps will server two purposes: 1. maintain relative order in both row and col; 2. make the vals in grid as small as possible.