3467. Transform Array by Parity
You are given an integer array
nums
. Transformnums
by performing the following operations in the exact order specified:
- Replace each even number with 0.
- Replace each odd numbers with 1.
- Sort the modified array in non-decreasing order.
Return the resulting array after performing these operations.
c++
1 | class Solution { |