Minimum Cost To Make String Valid Leetcode 1508