Minimize the Cost of a String

Company: Cashfree_17oct

Difficulty: medium