12月亚麻OA1
8813
1. example input:
input:
row: 4:
columns = 5
grid:
[[0,1,1,0,1],
[0,1,0,1,0],
[0,0,0,0,1],
[0,1,0,0,0]]
output: 2
explanation:
at the end of first hour:
1,1,1,1,1
1,1,1,1,1
0,1,0,1,1
1,1,1,0,1
at the end of 2 hour:
1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
2. testcase1
input: 4, 4
[[1,1,0,0],
[0,0,0,0],
[0,0,1,1],
[0,0,0,0]]
expected return value:
2
testcase 2:
input: 7, 7
[
[1,0,0,0,0,0,0],
[0,1,0,0,0,0,0],
[0,0,1,0,0,0,0],
[0,0,0,1,0,0,0],
[0,0,0,0,1,0,0],
[0,0,0,0,0,1,0],
[0,0,0,0,0,0,1]
]
input:
row: 4:
columns = 5
grid:
[[0,1,1,0,1],
[0,1,0,1,0],
[0,0,0,0,1],
[0,1,0,0,0]]
output: 2
explanation:
at the end of first hour:
1,1,1,1,1
1,1,1,1,1
0,1,0,1,1
1,1,1,0,1
at the end of 2 hour:
1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
1,1,1,1,1
2. testcase1
input: 4, 4
[[1,1,0,0],
[0,0,0,0],
[0,0,1,1],
[0,0,0,0]]
expected return value:
2
testcase 2:
input: 7, 7
[
[1,0,0,0,0,0,0],
[0,1,0,0,0,0,0],
[0,0,1,0,0,0,0],
[0,0,0,1,0,0,0],
[0,0,0,0,1,0,0],
[0,0,0,0,0,1,0],
[0,0,0,0,0,0,1]
]
- 1
3条回复