[C++] Simple Solution(100% Time, 98% Memory)
\n\nclass Solution {\npublic:\n    \n    string strWithout3a3b(int A, int B) {\n        \n        string finalStr = "";\n        while(A || B)\n\t\t{ // Check w
\n```\nclass Solution {\npublic:\n    \n    string strWithout3a3b(int A, int B) {\n        \n        string finalStr = "";\n        while(A || B)\n\t\t{ // Check whether either A or B is zero \n            if(!A) {finalStr += ((B==1) ? "b" : "bb");  break;}\n            if(!B) {finalStr += ((A==1) ? "a" : "aa");  break;}\n            \n            if(A>B) {\n                finalStr += "aab";\n                A-=2; B-=1; }\n            else if(A==B) {\n                finalStr += "ab";\n                A--; B--;}\n            else {\n                finalStr += "bba";\n                A-=1; B-=2; }\n            \n        }\n        return finalStr;\n    }\n};\n```
[]