Question: IBM Online Assessment (OA) January 17th, 2026 || Coding Questions & Solutions | HackerRank Jan2026 | Minimum Cost String Transformation
0
Entering edit mode

Minimum Cost String Transformation

Problem Statement:

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.

Constraints:

  • 1 <= length of  s, t <= 2 *10^5
  • Strings s and t contain only lowercase English letters.
ADD COMMENTlink 4 hours ago Rohit • 0

Login before adding your answer.

Similar Posts
Loading Similar Posts