Find the total paths from left/up corner to right/bottom corner in an 2D grid with Dynamic Programming