2019/03in.txt | 2019/03in.txt | ||||
2019/jessin.txt |
for k,v in grid.items(): | for k,v in grid.items(): | ||||
if v[0] != 0 and v[1] != 0 and k != (0,0): | if v[0] != 0 and v[1] != 0 and k != (0,0): | ||||
dists.append(abs(v[0]) + abs(v[1])) | dists.append(abs(v[0]) + abs(v[1])) | ||||
print(dists) | |||||
print(sorted(dists)) | |||||
print(min(dists)) | print(min(dists)) | ||||
if __name__ == "__main__": | if __name__ == "__main__": |