[C++] Faster Than 100% | Greedy solution | clean and concise
Please upvote if it helps!\n\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        string ans="";\n        int n=a+b;\n        int x=0,
Please upvote if it helps!\n```\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        string ans="";\n        int n=a+b;\n        int x=0, y=0;\n        for(int i=0;i<n;i++)\n        {\n            if((a>=b && x!=2) || (y==2 && a>0))\n            {\n                x++;a--;y=0;\n                ans+=\'a\';\n            }\n            else if((b>=a && y!=2) || (x==2 && b>0))\n            {\n                y++;b--;x=0;\n                ans+=\'b\';\n            }\n        }\n        return ans;\n    }\n};\n```
['Greedy', 'C', 'C++']