← All problemsSign in

3875. Construct Uniform Parity Array I

LeetCodeArrayMathOpen on judge ↗

You are given an array nums1 of n distinct integers. You want to construct another array nums2 of length n such that the elements in nums2 are 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 index j != i Return true if it is possible to construct such an array, otherwise,

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start