Rust heap and matching
Code is short thanks to Rust\'s pattern matching:\nrust\nuse std::collections::BinaryHeap;\n\nimpl Solution {\n    pub fn last_stone_weight(stones: Vec<i32>) ->
Code is short thanks to Rust\'s pattern matching:\n```rust\nuse std::collections::BinaryHeap;\n\nimpl Solution {\n    pub fn last_stone_weight(stones: Vec<i32>) -> i32 {\n        let mut heap = BinaryHeap::from(stones);\n        loop {\n            match (heap.pop(), heap.pop()) {\n                (Some(a), Some(b)) => if a > b {\n                    heap.push(a - b);\n                }\n                (Some(a), None) => return a,\n                (None, _) => return 0,\n            };\n        }\n    }\n}\n```
['Rust']