1374. Generate a String With Characters That Have Odd Counts

Обновлено: 2024-03-12
1 мин
[]

Содержание

LeetCode problem 1374

class Solution:
    def generateTheString(self, n: int) -> str:
        return 'a' * n if n & 1 else 'a' * (n - 1) + 'b'