Driven Program
int main ( ) { char X [ ] = " abble " ; char Y [ ] = " pie " ; int n = strlen ( X ) ; int m = strlen ( Y ) ; int k = 2 ; int dp [ N ] [ N ] [ N ] ; memset ( dp , -1 , sizeof dp ) ; int ans = solve ( X , Y , n - 1 , m - 1 , k , dp ) ; cout << ( ans == 1e9 ? -1 : ans ) << endl ; return 0 ; }