C++ Simple Logic Best Code :)
\n\nclass Solution\n{\npublic:\n    string strWithout3a3b(int a, int b)\n    {\n\n        string s;\n        if (a > b)\n        {\n            while (a != 0)\n
```\n\nclass Solution\n{\npublic:\n    string strWithout3a3b(int a, int b)\n    {\n\n        string s;\n        if (a > b)\n        {\n            while (a != 0)\n            {\n                s += \'a\';\n                a--;\n\n                if (a > b)\n                {\n                    s += \'a\';\n                    a--;\n                }\n\n                if (b != 0)\n                {\n                    s += \'b\';\n\n                    b--;\n                }\n            }\n        }\n        else if (b > a)\n        {\n            while (b != 0)\n            {\n\n                s += \'b\';\n                b--;\n                if (b > a)\n                {\n                    s += \'b\';\n                    b--;\n                }\n\n                if (a != 0)\n                {\n                    s += \'a\';\n\n                    a--;\n                }\n            }\n        }\n        else if (a == b)\n        {\n            int n = a + b;\n            for (int i = 0; i < n / 2; i++)\n            {\n                s += \'a\';\n                s += \'b\';\n            }\n        }\n        return s;\n    }\n};\n```
[]