Company: IBM_2oct_oncampus
Difficulty: medium
Minimum Cost String Transformation Problem Description Given two strings s and t , determine the minimum total cost required to transform s into t using the following operation any number of times, including zero: Select an index i such that 0 ≤ i < length of s . Remove the character at index i . Concatenate the remaining characters in order. The step costs i units. If the transformation is not possible, return -1 . Examples Example 1: Input: s = "abacc", t = "aba" Output: 6 Explanation: The character removed in each step is underlined in the original problem statement. Here's a breakdown of the transformation steps: Step 1: Current s is "abacc". Choose index i = 3 (the second 'c'). The cost for this step is 3 . After removal, s becomes "abac". Step 2: Current s is "abac". Choose index i = 3 (the remaining 'c'). The cost for this step is 3 . After removal, s becomes "aba". The total cost is 3 + 3 = 6. Example 2: Input: s = "abcde", t = "acx" Output: -1 Explanation: It is not poss