If not same , then find the larger of two and go in the direction of larger value
else if ( dp [ k - 1 , l ] < dp [ k , l - 1 ] ) { res = a [ k - 1 ] + res ; -- ; } else { res = b [ l - 1 ] + res ; -- ; } }