First version of the set matrix to zeroes problem. In-place implementation. Use the first row/column to record status.