Tap here to switch tabs
Problem
Submissions

Problem: Split the Array

med
30 min
Try to solve the Split the Array problem.

Statement

You are given an integer array nums of even length. You need to split nums into two arrays nums1 and nums2 such that:

  • nums1.length == nums2.length == nums.length /2/ 2

  • nums1 contains only distinct elements.

  • nums2 contains only distinct elements.

Return true if it is possible to split the array, and false otherwise.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • nums.length (mod2)=0\pmod 2 = 0

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Split the Array

med
30 min
Try to solve the Split the Array problem.

Statement

You are given an integer array nums of even length. You need to split nums into two arrays nums1 and nums2 such that:

  • nums1.length == nums2.length == nums.length /2/ 2

  • nums1 contains only distinct elements.

  • nums2 contains only distinct elements.

Return true if it is possible to split the array, and false otherwise.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • nums.length (mod2)=0\pmod 2 = 0

  • 1≤1 \leq nums[i] ≤100\leq 100