rust 105ms
rust\nimpl Solution {\n    pub fn recover_array(nums: Vec<i32>) -> Vec<i32> {\n        use std::collections::HashMap;\n        let mut nums = nums.clone();\n   
```rust\nimpl Solution {\n    pub fn recover_array(nums: Vec<i32>) -> Vec<i32> {\n        use std::collections::HashMap;\n        let mut nums = nums.clone();\n        nums.sort();\n        let smallest = nums[0];\n        let mut last_k = -1;\n        let mut left = HashMap::new();\n        for &n in &nums {\n            if !left.contains_key(&n) { left.insert(n, 1); }\n            else { left.insert(n, left.get(&n).unwrap() + 1); }\n        }\n        \'out: for &n in (&nums[1..]).iter() {\n            let k = n - smallest;\n            if k == last_k || k % 2 != 0 || k == 0 { continue; }\n            last_k = k;\n            // enumeration\n            let mut table = left.clone();\n            let mut ret = Vec::new();\n            for &n in nums.iter() {\n                if table.get(&n).unwrap().clone() == 0 { continue; }\n                let counterpart = n + k;\n                if !table.contains_key(&counterpart) || table.get(&counterpart).unwrap().clone() == 0\n                { continue \'out; }\n                ret.push(n + k / 2);\n                table.insert(n, table.get(&n).unwrap() - 1);\n                table.insert(counterpart, table.get(&counterpart).unwrap() - 1);\n            }\n            return ret;\n        }\n        return Vec::new();\n    }\n}\n```
[]