beats 100% for runtime and memory - Single iterator chain
Intuition\nThe fun thing about binary is everything is or it isn\'t. You always know what a white is because it\'s a not-black. This makes counting up easier. W
# Intuition\nThe fun thing about binary is everything is or it isn\'t. You always know what a white is because it\'s a not-black. This makes counting up easier. We don\'t need to do anything but see how far the whites are from the front, where they need to be.\n\n# Approach\nTwo enumerators, oh my! We enumerate and filter all the whites so we know how far they are from the start. Then we enumerate AGAIN so we know how many whites there are in total. From that we know how far they need to move. Simple!\n\n# Complexity\n- Time complexity:\n$$O(n)$$\nOne scan.\n\n- Space complexity:\n$$O(1)$$\nIt\'s just an iterator.\n\n# Code\n```rust []\nimpl Solution {\n    pub fn minimum_steps(s: String) -> i64 {\n        s.chars().enumerate()\n            .filter(|(_, ch)| *ch == \'0\')\n            .enumerate()\n            .map(|(whites, (i, _))| i - whites)\n            .sum::<usize>() as _\n    }\n}\n```
['Rust']