← ALL NOTES
Array

2033. Minimum Operations to Make a Uni-Value Grid

Grid of integers and a value x. Each operation adds or subtracts x from any cell. Find the minimum operations to make all cells equal, or −1 if impossible. Every change is a multiple of x, so…

Loading…