Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Simple and Short solution in Creative category for Can You Pass? by StefanPochmann
def can_pass(matrix, first, second):
reach = [first]
for i,j in reach:
reach += [(I,J) for I,row in enumerate(matrix) for J,a in enumerate(row)
if abs(i-I)+abs(j-J)<2 and a==matrix[i][j] and (I,J) not in reach]
return second in reach
April 28, 2015
Comments: