Partition a string into substrings that all have majority characters I’m trying to solve this problem: