(nums: Vec<i32>)
| 2 | |
| 3 | impl Solution { |
| 4 | pub fn single_number(nums: Vec<i32>) -> Vec<i32> { |
| 5 | use std::collections::HashMap; |
| 6 | let mut mmp = HashMap::new(); |
| 7 | for num in nums { |
| 8 | let count = mmp.entry(num).or_insert(0); |
| 9 | *count += 1; |
| 10 | } |
| 11 | mmp.retain(|_, v|*v==1); |
| 12 | mmp.into_keys().collect::<Vec<i32>>() |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | fn main() { |
nothing calls this directly
no outgoing calls
no test coverage detected