Write a function that replaces every row and column that contains at least one 1 into a row/column that is filled entirely with 1s.
Solve this without returning a copy of the input list.
ones_infection([
[0, 0, 1],
[0, 0, 0],
[0, 0, 0]
]) ➞ [
[1, 1, 1],
[0, 0, 1],
[0, 0, 1]
]
ones_infection([
[1, 0, 1, 0],
[0, 1, 0, 0],
[0, 0, 0, 0]
]) ➞ [
[1, 1, 1, 1],
[1, 1, 1, 1],
[1, 1, 1, 0]
]
ones_infection([
[0, 1, 0, 1],
[0, 0, 0, 0],
[0, 1, 0, 0]
]) ➞ [
[1, 1, 1, 1],
[0, 1, 0, 1],
[1, 1, 1, 1]
]