Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Hidden? solution in Uncategorized category for Digging a Canal by veky
def checkio(data):
aux=[0]*len(data[0])
data[:0]=[aux]
data.append(aux)
D,Q={},{(len(data)-1,0):0}
while Q:
v=i,j=min(Q,key=Q.get)
r=D[v]=Q.pop(v)
if v==(0,0): return r
Q.update({(ni,nj):r+data[ni][nj] for ni,nj in [(i-1,j),(i+1,j),(i,j-1),(i,j+1)]
if (ni,nj) not in D if 0<=ni
June 19, 2013
Comments: