Easy to understand java solution
\npublic String strWithout3a3b(int A, int B) {\n        if (A > B) {\n            return helper(A, \'a\', B, \'b\');\n        }\n        return helper(B, \'b\',
```\npublic String strWithout3a3b(int A, int B) {\n        if (A > B) {\n            return helper(A, \'a\', B, \'b\');\n        }\n        return helper(B, \'b\', A, \'a\');\n    }\n\n    private String helper(int ca, char a, int cb, char b) {\n        StringBuilder sb = new StringBuilder();\n        while (ca-- > 0) {\n            sb.append(a);\n            if (ca > cb) {\n                sb.append(a);\n                ca--;\n            }\n            if (cb-- > 0) {\n                sb.append(b);\n            }\n        }\n        return sb.toString();\n    }\t\n```
[]