c++ greedy solution ✔
\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        string ans="";\n        \n        // while both \'a\' and \'b\' are available\n 
```\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        string ans="";\n        \n        // while both \'a\' and \'b\' are available\n        while(a && b){\n            if(a>b){        // case 1\n                ans+= "aab";\n                a-=2;\n                b--;\n            }\n            else if(b>a){   //case 2\n                ans+= "bba";\n                b-=2;\n                a--;\n            }\n            else{          //case 3\n                ans+= "ab";\n                a--;\n                b--;\n            }\n        }\n        \n        // when only \'a\' is available\n        while(a){\n            ans+="a";\n            a--;\n        }\n        \n        // when only \'b\' is available\n        while(b){\n            ans+= "b";\n            b--;\n        }\n        \n        return ans;\n    }\n};\n```\n\nif you find this helpful plz upvote
['Greedy', 'C']