13 lines
262 B
Python
13 lines
262 B
Python
from collections import defaultdict
|
|
|
|
|
|
class Grid:
|
|
|
|
def __init__(self):
|
|
self.g = defaultdict(lambda: defaultdict(int))
|
|
|
|
def values(self):
|
|
for a, chunk in self.g.items():
|
|
for b, v in chunk.items():
|
|
yield a, b, v
|