Rust solution
\nimpl Solution {\n    pub fn last_stone_weight(stones: Vec<i32>) -> i32 {\n        use std::collections::BinaryHeap;\n\n        let mut h = BinaryHeap::from(st
```\nimpl Solution {\n    pub fn last_stone_weight(stones: Vec<i32>) -> i32 {\n        use std::collections::BinaryHeap;\n\n        let mut h = BinaryHeap::from(stones);\n        while h.len() > 1 {\n            let s1 = h.pop().unwrap();\n            let s2 = h.pop().unwrap();\n            h.push(s1 - s2)\n        }\n        h.pop().unwrap_or(0)\n    }\n}\n```
['Rust']