by making count of a and b equal and then removing the higher count character beats 100%
\n\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        int ca =0;\n        int cb = 0;\n        int times = max(a,b);\n        \n    
\n```\nclass Solution {\npublic:\n    string strWithout3a3b(int a, int b) {\n        int ca =0;\n        int cb = 0;\n        int times = max(a,b);\n        \n        string ans="";\n\n       \n\n        if(a>b){\n           for(int i=0;i<times;i++){\n          ans+="ab";\n        }\n          int bs = abs(b-a);\n       //   cout<<ans<<endl;\n          for(int i=1;i<ans.length();i=i+4){\n            ans[i] = \'r\';\n            bs--;\n            cout<<bs<<" ";\n            if(bs == 0){\n              break;\n            }\n          }\n          if(bs>0){\n            for(int i = ans.length()-1;i>=0;i--){\n              if(ans[i] == \'b\'){\n                 ans[i] = \'r\';\n                  bs--;\n              }\n              if(bs == 0){\n                break;\n              }\n            }\n          }\n      //  cout<<ans;\n        string temp = "";\n        for(int i=0;i<ans.length();i++){\n          if(ans[i] == \'r\'){continue;}\n          temp+=ans[i];\n          }\n          ans = temp;\n        }else if(b>a){\n           for(int i=0;i<times;i++){\n               ans+="ba";\n        }\n           int as = abs(b-a);\n       //   cout<<ans<<endl;\n          for(int i=1;i<ans.length();i=i+4){\n            ans[i] = \'r\';\n            as--;\n            //cout<<as<<" ";\n            if(as == 0){\n              break;\n            }\n          }\n          if(as>0){\n            for(int i = ans.length()-1;i>=0;i--){\n              if(ans[i] == \'a\'){\n                 ans[i] = \'r\';\n                  as--;\n              }\n              if(as == 0){\n                break;\n              }\n            }\n          }\n      //  cout<<ans;\n        string temp = "";\n        for(int i=0;i<ans.length();i++){\n          if(ans[i] == \'r\'){continue;}\n          temp+=ans[i];\n          }\n          ans = temp;\n        }else{\n    for(int i=0;i<times;i++){\n          ans+="ab";\n        }\n        }\n\n        return ans;\n    }\n};\n```
['C++']