String Without AAA or BBB
Code


# Code
```python []
class Solution(object):
    def strWithout3a3b(self, a, b):
        """
        :type a: int
        :type b: int
        :rtype: str
        """
        res = []
        while a > 0 or b > 0:
            if len(res) >= 2 and res[-1] == res[-2]:
                write_a = res[-1] == 'b'
            else:
                write_a = a >= b
            
            if write_a:
                res.append('a')
                a -= 1
            else:
                res.append('b')
                b -= 1
                
        return "".join(res)
```
['String', 'Greedy', 'Python']