fn main() { println!("Hello, world!"); let tests = [ vec![3,1,2,4], vec![0] ]; for test in tests { println!("{:?} {:?}", test, Solution::sort_array_by_parity(test.clone())); } } struct Solution; impl Solution { pub fn sort_array_by_parity(nums: Vec) -> Vec { let mut result = nums.clone(); result.sort_by_key(|x| x % 2); result } }