easy to understand
Intuition\n Describe your first thoughts on how to solve this problem. \nswaping concept have to use:\n\n# Approach\n Describe your approach to solving the prob
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nswaping concept have to use:\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nkeep two pointer at start and at end and then stop when start reach to 1 and end reach to  add the diff to ans and move ahead while i<j\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    long long minimumSteps(string s) {\n        int n=s.size();\n        int i=0,j=n-1;\n        long long int cnt=0;\n        while(i<j){\n            while( j>=0 and s[j]==\'1\') j--;\n            while( i<n and s[i]==\'0\') i++;\n            if(i<n and j>=0 and i<j ){\n                cnt+=(j-i);\n                cout<<(j-i)<<" ";\n                swap(s[i],s[j]);\n                i++;\n                j--;\n                \n            }\n        }\n        if(cnt<=0) return 0;\n        return cnt;\n        \n    }\n};\n```
['C++']