Java very simple greedy solution beats 100%
Simple idea is that if we have a >= 2*b or b >= 2*a then we consume greedily 2 chars from the character that has more characters followed by the other char. Con
Simple idea is that if we have `a >= 2*b` or `b >= 2*a` then we consume greedily 2 chars from the character that has more characters followed by the other char. Continue doing this repeatedely. Doing so we ensure that the last appended character is the char with lesser count. Now if we have `a >b` then append `ab`, else `ba`.  \n\n```\nclass Solution {\n    public String strWithout3a3b(int a, int b) {\n        \n        StringBuilder sb = new StringBuilder();\n        while (a > 0 && b > 0) {\n            if (a >= 2*b) {\n                sb.append("aab");\n                a -= 2;\n                b -= 1;\n            } else if (b >= 2*a) {\n                sb.append("bba");\n                b -= 2;\n                a -= 1;\n            } else if (a > b) {\n                sb.append("ab");\n                b -= 1;\n                a -= 1;\n            } else {\n                sb.append("ba");\n                b -= 1;\n                a -= 1;\n            }\n        }\n        \n        for (int i = 0; i < a; i++) sb.append("a");\n        for (int i = 0; i < b; i++) sb.append("b");\n        return sb.toString();\n        \n    }\n}\n```\n```
[]