Best Java Solution || Beats 95%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n\n    // taken some help\n\n\n    // First i get the index of  first "0", if it is not present then we will return the string itself\n    // otherwise we will count the number of "0" after that index;\n    // now we will shift that "0" by count number of times and fill all the place with "1"\n    // this is because we can always make the string that contains only one "0";\n    \n    public String maximumBinaryString(String s){\n\n        int n = s.length();\n\n        int a = s.indexOf("0");\n        if(a==-1) return s;\n\n        int zero = 0;\n\n        for(int i=a+1; i<n; i++){\n            if(s.charAt(i)==\'0\') zero++;\n        } \n\n        StringBuilder ans = new StringBuilder();\n        ans.append("1".repeat(n));\n\n        int x = a+zero;\n\n        ans.replace(x,x+1,"0");\n        return ans.toString();\n    }\n}\n```
['Java']