💯Very Easy Detailed Solution || 🎯 Brute Force
Intuition\n Describe your first thoughts on how to solve this problem. \nThe trick here is that the number of operations required to move a \'1\' to the right o
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe trick here is that the number of operations required to move a \'1\' to the right of \'0\' depends on how many \'1\'s have already been seen.\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1. **Initialization:**\n    - Start by counting the length of the string n.\n    - Use two variables:\n        - operations: To keep track of the total operations performed.\n        - countBlack (which counts the number of \'1\'s encountered so far).\n\n2. **Iterate through the string:**\nFor each character in the string:\n    - If it\'s a \'0\', the current number of operations needed to move previously encountered \'1\'s behind this \'0\' is added to the operations count.\n    - If it\'s a \'1\', increment the countBlack (as it represents \'1\'s that will need to be moved if a \'0\' is encountered later).\n\n3. **Explanation of Operations:**\n    - Each \'0\' causes all previously seen \'1\'s (countBlack) to be shifted to the right of that \'0\', which adds to the total operation cost.\n\n4. **Return Result:**\n    - Finally, return the total number of operations.\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$O(1)$$\n# Code\n```java []\nclass Solution {\n    public long minimumSteps(String s) {\n        int n = s.length();\n        long operations = 0, countBlack = 0;\n        for(int i=0; i<n; i++){\n            if(s.charAt(i) == \'0\'){\n                operations += countBlack; \n            }\n            else{\n                countBlack++;\n            }\n        }\n        return operations;\n    }\n}\n```
['Math', 'Two Pointers', 'String', 'Counting', 'Java']