LeetCode-in-Java

3875. Construct Uniform Parity Array I

Easy

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):

Return true if it is possible to construct such an array, otherwise, return false.

Example 1:

Input: nums1 = [2,3]

Output: true

Explanation:

Example 2:

Input: nums1 = [4,6]

Output: true

Explanation:

Constraints:

Solution

@SuppressWarnings("java:S1172")
public class Solution {
    public boolean uniformArray(int[] nums1) {
        return true;
    }
}