simple C++ solution 100% faster
\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        \n        string ans="";\n        int ca=0,cb=0;  //maintain count of last conti
```\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        \n        string ans="";\n        int ca=0,cb=0;  //maintain count of last continuously appended a\'s or b\'s\n        \n        while(a>0 || b>0)\n        {\n            if(a>=b && ca<2 || (b>=a && cb>=2))\n            {\n                ans+=\'a\';\n                ca++;\n                cb=0;\n                a--;\n            }\n            else\n            {\n                ans+=\'b\';\n                cb++;\n                ca=0;\n                b--;\n            }\n        }\n          return ans;\n    }\n};\n```
['C', 'C++']