Explained || Greedy || simple shifting || pattern intuitive
\nclass Solution {\npublic:\n    string maximumBinaryString(string b) {\n     int n=b.size();\n     int zc=0;\n     string ans(n,\'1\');\n     for(int i=0;i<n;i
```\nclass Solution {\npublic:\n    string maximumBinaryString(string b) {\n     int n=b.size();\n     int zc=0;\n     string ans(n,\'1\');\n     for(int i=0;i<n;i++){\n         if(b[i]==\'0\')\n             zc++;\n     }\n     for(int i=0;i<n;i++){\n         if(b[i]==\'0\'){\n             ans[i+zc-1]=\'0\';\n             return ans;\n         }\n     }\n        return ans;\n    }\n};\n\n// 000110\n// 10->01\n// 00->10\n//point to note are final answer will contain only 1 zero \n//2. shift the leftmost zero to the index which is equal to count of number of zero why this to maximize are answer jitna last mai hoga utna maximize answer hoga :)\n        \n\n\n```\nPlease upvote if you like the solution
['C']