Skip to content

Commit cb22feb

Browse files
2206_Divide_Array_into_Equal_Pairs.java
1 parent 6bca638 commit cb22feb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Problem Number: 2206
2+
3+
// Divide Array into Equal Pairs.
4+
5+
class Solution {
6+
public boolean divideArray(int[] nums) {
7+
int[] count = new int[501];
8+
9+
for (final int num : nums)
10+
++count[num];
11+
12+
return Arrays.stream(count).allMatch(c -> c % 2 == 0);
13+
14+
}
15+
}

0 commit comments

Comments
 (0)