0

Apply gravity to this matrix
This was inspired by this question.
Given an \$m\times n\$ matrix of \$0\$'s and \$1\$'s, apply "gravity" to it. This means to drop down all the \$1\$'s as if they were affected by gravity.
For example
[[1,0,1,1,0,1,0]
[0,0,0,1,0,0,0]
[1,0,1,1,1,1,1]
[0,1,1,0,1,1,0...