Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Dict comprehension with auxiliary function solution in Creative category for Blood distribution by z60x43knmf
def dist(d,r,a,n): g=min(n[r],a[d]) if d in r+'O' else 0; a[d]-=g; n[r]-=g; return g
distribute_blood = lambda a,n: {d:{r:dist(d,r,a,n) for r in n} for d in a}
March 20, 2024
Comments: