Tap here to switch tabs
Problem
Submissions

Problem: Divide Array Into Equal Pairs

med
30 min
Try to solve the Divide Array Into Equal Pairs problem.

Statement

You are given an integer array nums consisting of 2imesn2 imes n integers.

You need to divide nums into nn pairs such that each element belongs to exactly one pair and both elements in each pair are equal.

Return true if nums can be divided into such pairs, or false otherwise.

Constraints:

  • nums.length =2imesn= 2 imes n

  • 1≤n≤5001 \leq n \leq 500

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Divide Array Into Equal Pairs

med
30 min
Try to solve the Divide Array Into Equal Pairs problem.

Statement

You are given an integer array nums consisting of 2imesn2 imes n integers.

You need to divide nums into nn pairs such that each element belongs to exactly one pair and both elements in each pair are equal.

Return true if nums can be divided into such pairs, or false otherwise.

Constraints:

  • nums.length =2imesn= 2 imes n

  • 1≤n≤5001 \leq n \leq 500

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