Driver Code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT X = " abble " NEW_LINE Y = " pie " NEW_LINE n = len ( X ) NEW_LINE m = len ( Y ) NEW_LINE k = 2 NEW_LINE dp = [ [ [ - 1 ] * N for __ in range ( N ) ] for ___ in range ( N ) ] NEW_LINE ans = solve ( X , Y , n - 1 , m - 1 , k , dp ) NEW_LINE print ( - 1 if ans == 1000000000 else ans ) NEW_LINE DEDENT