Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Data and undata structures solution in Clear category for Cleaning Robot by veky
to = dict(A='AABD',B='ABCE',C='BCCF',D='ADEG',E='BDFH',F='CEFI',G='DGGH',H='EGHI',I='FHII')
def update(p, j):
q = dict.fromkeys(p, 0)
for x in p:
for y in to[x]: q[y if y != j else x] += p[x] / 4
return q
def cleaning_robot(cap, start, bat, junk):
prob = {room: room == start for room in to}
for () in [()] * cap: prob = update(prob, junk)
return prob[bat]
Nov. 3, 2023