There are k enemies (numbered from 0 to k-1) in n x m grid. Geekina has arrays col and count.
The value col[i] represents the column of the ith enemy, while count[j] denotes the count of
enemies in the jth row. It is ensured that for any two enemies x and y with x < y, row[x] <= row[y].
Return the grid with enemies, marking cells without enemies as -1.
Example 1:
Input:
n = 3
m = 3
k = 3
col = {0, 0, 1}
count = {1, 1, 1}
Output:
{{0, -1, -1},
{1, -1, -1},
{-1, 2, -1}}
Explanation:
The rst row should have 1 enemy because count[0] = 1, the enemy 0 should be
placed at row 0 and column 0 of the grid.
The second row should have 1 enemy because count[1] = 1, the enemy 1 should be
placed at row 1 and column 0 of the grid.
The third row should have 1 enemy because count[2] = 1, the enemy 2 should be
placed at row 2 and column 1 of the grid.
-----
构造题目,找到敌人的数量即可。我用数组来模拟,然后放到list中的。没想到还能过,,,