Simple java solution
Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n\n# Code\n\nclass Solution {\n    public long minimumSteps(String s) {\n        long ans=0;\n  
# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(1)$$\n\n# Code\n```\nclass Solution {\n    public long minimumSteps(String s) {\n        long ans=0;\n        int count=0;\n        int len=s.length();\n        for(int i=len-1;i>=0;i--)\n        {\n            char c=s.charAt(i);\n            if(c==\'1\')\n            {\n                ans+=(long)(len-count-1-i);\n                count++;\n            }\n        }\n        return ans;\n    }\n}\n```
['Java']