I have a list of lists with 0 and 1:
cells = [
[1, 1, 1, 1],
[0, 0, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]
]
How can I move each unit to the maximum number of zeros beneath it in the same column, and if another unit is encountered, move the current unit in front of it, with the starting list of units taking on zero values after the movement?
New contributor
Ulfy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1