AC edit distance , 2d DP sol