Dynamic programming
Can we apply this trick in 2D as well?
d
x-1,y
d
x,y
d
x-1,y-1
d
x,y-1
No:
d
x,y-1
and
d
x-1,y
may depend on different values of
d
x-1,y-1