思维
看每个0
的左边有多少个1
class Solution {
public:
typedef long long LL;
long long minimumSteps(string s) {
LL res = 0;
for (int i = 0, cnt = 0; i < s.size(); i ++ )
if (s[i] == '0') res += cnt;
else cnt ++ ;
return res;
}
};