← 返回 walmartlabs 的题目列表Find Full Zero Rows and Columns in a Matrix
类型:online_judge
Given a matrix composed of 0s and 1s, where 0 indicates a walkable path and 1 is an obstacle, find all row and column indices that are fully composed of 0s when moving in a straight line.
Input:
An m x n integer matrix containing only 0s and 1s.
Output:
A list that includes all row indices and column indices that are fully made of 0s.
Example:
Input:
[[0, 1, 0],
[0, 0, 0],
[1, 0, 1]]
Output:
Row indices: [1]
Column indices: []
Constraints:
1 <= m, n <= 1000
Implement code to accomplish the above task.
Example
Input
[[0, 1, 0], [0, 0, 0], [1, 0, 1]]