0MS Beats 100% 👍👍Beginner Friendly Recursive Easy to understand
Intuition\nPlease Upvote if this Find HelpFull\uD83D\uDC4D\uD83D\uDC4D\n\n# Code\n\nclass Solution {\npublic:\n\n    void generator(string &arr,int &a,int &b){\
# Intuition\nPlease Upvote if this Find HelpFull\uD83D\uDC4D\uD83D\uDC4D\n\n# Code\n```\nclass Solution {\npublic:\n\n    void generator(string &arr,int &a,int &b){\n\n        if (a<=0 && b<=0){\n            return;\n        }\n\n        if(a>b){\n            if(a>=2){\n                arr=arr+"aa";\n                a-=2;\n            }\n            else{\n                arr=arr+\'a\';\n                a-=1;\n            }\n            if(b>=1){\n                arr=arr+\'b\';\n                b-=1;\n            }\n            \n        }\n        else if(b>a){\n            if(b>=2){\n                arr=arr+"bb";\n                b-=2;\n            }\n            else{\n                arr=arr+\'b\';\n                b-=1;\n            }\n            if(a>=1){\n                arr=arr+\'a\';\n                a-=1;\n            }\n        }\n        else{\n            arr=arr+\'a\'+\'b\';\n            a-=1;\n            b-=1;\n        }\n        generator(arr, a, b);\n    }\n    \n\n    string strWithout3a3b(int a, int b) {\n\n        string arr ="";\n        generator(arr, a, b);\n        return arr;\n        \n    }\n};\n```
['String', 'Greedy', 'Recursion', 'C++']