给你一个整数数组 nums
。请你按照以下顺序 依次 执行操作,转换 nums
:
执行完这些操作后,返回结果数组。
示例 1:
输入:nums = [4,3,2,1]
输出:[0,0,1,1]
解释:
nums = [0, 1, 0, 1]
。nums
,得到 nums = [0, 0, 1, 1]
。示例 2:
输入:nums = [1,5,1,4,2]
输出:[0,0,1,1,1]
解释:
nums = [1, 1, 1, 0, 0]
。nums
,得到 nums = [0, 0, 1, 1, 1]
。
提示:
1 <= nums.length <= 100
1 <= nums[i] <= 1000
x
be the number of even numbers, and y
be the number of odd numbers. Output 0
x
times, followed by 1
y
times.