Longest Happy String - Leetcode 1405 - Python