1374. Generate a String With Characters That Have Odd Counts Updated: 2024-03-12 1 min read Algorithms , LeetCode On This PageLeetCode problem 1374class Solution: def generateTheString(self, n: int) -> str: return 'a' * n if n & 1 else 'a' * (n - 1) + 'b'