fold
We compute the sum of the digits where the odd positions are weighted with $-1$.\n\nrust []\nimpl Solution {\n    pub fn is_balanced(num: String) -> bool {\n   
We compute the sum of the digits where the odd positions are weighted with $-1$.\n\n```rust []\nimpl Solution {\n    pub fn is_balanced(num: String) -> bool {\n        num.chars().fold((0, 1), |(s, f),d|\n            (s+f*(d as i32 - \'0\' as i32), -f)\n        ).0 == 0\n    }\n}\n```
['Rust']