[Java] Simple Greedy
\n\nclass Solution {\n    public String strWithout3a3b(int A, int B) {\n        StringBuilder ans = new StringBuilder();\n        int size = A+B;\n        int a
\n```\nclass Solution {\n    public String strWithout3a3b(int A, int B) {\n        StringBuilder ans = new StringBuilder();\n        int size = A+B;\n        int a = 0, b = 0;\n        for(int i = 0; i < size; i++){\n            if((A >= B && a != 2)  || b == 2){ \n                ans.append("a");\n                A--;\n                a++;\n                b = 0;\n            }else if((B >= A && b != 2) || a == 2) {\n                ans.append("b");\n                b++;\n                B--;\n                a = 0;\n            }\n            \n        }\n        \n        return ans.toString();\n    }\n}\n```
[]