AlgoMaster Logo

Maximum Number of Points with Cost

points=[[1,2,3],[1,5,1],[3,1,1]]
0 / 26
grid = 3x3123151311dpleftrightpick one cell per row; every column switch costs the distance
algomaster.io
Step:Pick one cell per row. Switching columns between rows costs the distance moved