From neighbors to neighbors with memorisation of previous steps... solution in Clear category for Can You Pass? by Phil15
"""The minimal numbers of steps to go to b from a
(a and b are coordinates tuples).
return abs(a-b) + abs(a-b)
def neighbors(grille, me, previous):
"""We list neighbors of me if grille's values are equals
and if we don't have visited them before.
x,y = me
r,c = len(grille), len(grille)
return [(u,v) for (u,v) in [(x,y-1),(x,y+1),(x-1,y),(x+1,y)] #Possibles neighbors
March 28, 2018