Total Characters in String After Transformations II | Leetcode 3337