fn main() { println!("Hello, world!"); } struct Solution; impl Solution { pub fn remove_element(nums: &mut Vec, val: i32) -> i32 { let elements: Vec<_> = nums.iter().enumerate().filter(|(_,&num)| num == val).map(|(i,_)| i).collect(); for i in &elements { nums.remove(*i); } elements.len() as i32 } }