In [1]:
from typing import Dict, Tuple, List
In [2]:
class Grid:
    def __init__(self, rows: List):
        self._rows = rows
In [3]:
class Solution:
    def __init__(self, sensors: Tuple, grid: Grid):
        self._sensors = sensors
        self._sensors_coor = [ (None,None) for i in self._sensors ]
    def setsensor(self, sensor: int, coor: Tuple):
        self._sensors_coor[sensor] = coor
    def printsolution(self):
        pass
In [4]:
g = Grid([[1,1,0,0,1,0], [1,0,0,1,1,1], [0,0,1,1,1,1], [1,1,1,1,1,1], [0,0,0,1,1,1], [1,1,1,1,0,0]])
g._rows
Out[4]:
[[1, 1, 0, 0, 1, 0],
 [1, 0, 0, 1, 1, 1],
 [0, 0, 1, 1, 1, 1],
 [1, 1, 1, 1, 1, 1],
 [0, 0, 0, 1, 1, 1],
 [1, 1, 1, 1, 0, 0]]
In [5]:
s = Solution([3,2,2,1], g)
s.setsensor(2,(1,3))
s._sensors_coor
Out[5]:
[(None, None), (None, None), (1, 3), (None, None)]
In [6]:
g.printgrid()
  1 2 3 4 5 6
1 - - X X - X
2 - X X - - -
3 X X - - - -
4 - - - - - -
5 X X X - - -
6 - - - - X X
In [ ]:
 
In [ ]: