2D DP length first