Runtime 0ms Beats 100% ✅ || Very easy✅ || Solution C++
\n\n# Complexity\n- Time complexity: O(N)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n
\n\n# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        string ans="";\n        while(a and b){\n            if(a > b) ans += "aab", a--;\n            else if(b > a) ans +="bba", b--;\n            else ans += "ab";\n            a--, b--;\n        }\n        while(a) ans +=\'a\' , a--;\n        while(b) ans +=\'b\' , b--;\n        return ans;\n    }\n};\n```
['Greedy', 'C++']