You are given an integer array nums1 consisting of distinct positive integers.
You want to construct an integer array nums2 of the same length such that every element in nums2 is a positive integer and all elements in nums2 have the same parity (either all even or all odd).
For each index i, you can choose to:
Set nums2[i] = nums1[i], or
Choose an index j such that nums1[i] > nums1[j] and set nums2[i] = nums1[i] - nums1[j].
Return true if it is possible to construct such an array nums2, or false otherwise.
Constraints:
nums1.length
nums1[i]
nums1 consists of distinct integers.
You are given an integer array nums1 consisting of distinct positive integers.
You want to construct an integer array nums2 of the same length such that every element in nums2 is a positive integer and all elements in nums2 have the same parity (either all even or all odd).
For each index i, you can choose to:
Set nums2[i] = nums1[i], or
Choose an index j such that nums1[i] > nums1[j] and set nums2[i] = nums1[i] - nums1[j].
Return true if it is possible to construct such an array nums2, or false otherwise.
Constraints:
nums1.length
nums1[i]
nums1 consists of distinct integers.