3875. Construct Uniform Parity Array I
You are given an array
nums1ofndistinct integers.You want to construct another array
nums2of lengthnsuch that the elements innums2are either all odd or all even.For each index
i, you must choose exactly one of the following (in any order):
nums2[i] = nums1[i]nums2[i] = nums1[i] - nums1[j], for an indexj != iReturn
trueif it is possible to construct such an array, otherwise, returnfalse.
1 |
|