GREEDY APPROACH || 0ms || BEATS 100% TIME
\n\n# Code\n\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        if(a == 0 && b == 0) return "";\n        if(a == 0)return b == 2?"bb
\n\n# Code\n```\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        if(a == 0 && b == 0) return "";\n        if(a == 0)return b == 2?"bb":"b";\n        if(b == 0)return a == 2?"aa":"a";\n        string ans = "";\n        if(a >= 2*b || b >= 2*a){\n            if(a>b){\n                while(b){\n                    ans += "aab";\n                    a -= 2;\n                    b--;\n                }\n                while(a){\n                    ans += "a";\n                    a--;\n                }\n                return ans;\n            }\n            else{\n                while(a){\n                    ans += "bba";\n                    b -= 2;\n                    a--;\n                }\n                while(b){\n                    ans += "b";\n                    b--;\n                }\n                return ans;\n            }\n        }\n\n        if(a>b)return "ab" + strWithout3a3b(a-1,b-1);\n        return "ba" + strWithout3a3b(a-1,b-1);\n    }\n};\n```
['C++']