You are given an integer array
nums
of even length. You have to split the array into two partsnums1
andnums2
such that:
nums1.length == nums2.length == nums.length / 2
.nums1
should contain distinct elements.nums2
should also contain distinct elements.Return
true
if it is possible to split the array, andfalse
otherwise**.
1 | class Solution { |