0ms Java Solution | Greedy
\nclass Solution {\n    public String strWithout3a3b(int a, int b) {\n        int a_count = 0;\n        int b_count = 0;\n        int n = a + b;\n        \n    
```\nclass Solution {\n    public String strWithout3a3b(int a, int b) {\n        int a_count = 0;\n        int b_count = 0;\n        int n = a + b;\n        \n        StringBuilder sb = new StringBuilder();\n        for(int i = 0; i < n; i++)\n        {\n            if(a >= b && a_count < 2 || b_count == 2 && a > 0 ){\n                sb.append(\'a\');\n                a--;\n                a_count++;\n                b_count = 0;\n            }\n            \n            else if(b >=a && b_count < 2 || a_count == 2 && b > 0 ){\n                sb.append(\'b\');\n                b--;\n                a_count = 0;\n                b_count++;\n            }\n            \n        }\n        return sb.toString();    \n        \n    }\n}\n```
['Greedy', 'Java']