aboutsummaryrefslogtreecommitdiff
path: root/challenge-343/eric-cheung/python/ch-2.py
blob: 69376991e26937345b4aca97706034e5109329b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import numpy as np

## arrGrid = [[0, 1, 1], [0, 0, 1], [0, 0, 0]]  ## Example 1
## arrGrid = [[0, 1, 0, 0], [0, 0, 0, 0], [1, 1, 0, 0], [1, 1, 1, 0]]  ## Example 2
## arrGrid = [[0, 1, 0, 1], [0, 0, 1, 1], [1, 0, 0, 0], [0, 0, 1, 0]]  ## Example 3
## arrGrid = [[0, 1, 1], [0, 0, 0], [0, 1, 0]]  ## Example 4
arrGrid = [[0, 0, 0, 0, 0], [1, 0, 0, 0, 0], [1, 1, 0, 1, 1], [1, 1, 0, 0, 0], [1, 1, 0, 1, 0]]  ## Example 5

arrWins = [sum(arrLoop) for arrLoop in arrGrid]

print (np.argmax(arrWins))