Full Columns
grid is a 2-D array of 0s and 1s. A column is full if every cell in it is 1. Return how many columns are full.
Example 1
grid [[1,0,1],[1,1,1]]
returns 2
Columns 0 and 2 are all ones; column 1 has a 0.
Constraints
1 <= rows, columns <= 10- Every value is 0 or 1
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Good ColumnsEasy
- Group MaximumsEasy
- Is SortedEasy
- Is SymmetricEasy
- Largest GapEasy
- Latest PeakEasy
- Merge and SortEasy
- Missing NumbersEasy