funcexchange(_nums: [Int]) -> [Int] { var array = nums var left =0 var right = array.count -1 while left < right { while left < right && array[left] %2==1 { left +=1 } while left < right && array[right] %2==0 { right -=1 } array.swapAt(left, right) left +=1 right -=1 } return array }