1impl Solution {2 pub fn sort_array_by_parity(nums: Vec<i32>) -> Vec<i32> {3 let mut even = Vec::new();4 let mut odd = Vec::new();56 for num in nums {7 if num % 2 == 0 {8 even.push(num);9 } else {10 odd.push(num);11 }12 }1314 even.extend(odd);15 even16 }17}
WPM •0 •0
ACC •0 •0
TIME •0