Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Process the elements in the array one by one in any order and only create a new row in the matrix when we cannot put it into the existing rows
We can simply iterate over the existing rows of the matrix to see if we can place each element.