Rust solution
\nimpl Solution {\n    pub fn cal_points(ops: Vec<String>) -> i32 {\n        let mut res = Vec::new();\n        for s in ops.iter() {\n            match s.as_st
```\nimpl Solution {\n    pub fn cal_points(ops: Vec<String>) -> i32 {\n        let mut res = Vec::new();\n        for s in ops.iter() {\n            match s.as_str() {\n                "C" => res.truncate(res.len() - 1),\n                "D" => res.push(*res.last().unwrap() * 2),\n                "+" => res.push(res.iter().rev().take(2).sum()),\n                d => res.push(d.parse::<i32>().unwrap()),\n            }\n        }\n        res.iter().sum::<i32>()\n    }\n}\n```
['Rust']