Skip to content

Commit 05f538c

Browse files
committed
Runtime: 8 ms (Top 41.3%) | Memory: 44.12 MB (Top 6.5%)
1 parent 9bf16be commit 05f538c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Runtime: 8 ms (Top 41.3%) | Memory: 44.12 MB (Top 6.5%)
2+
3+
class Solution {
4+
public boolean divideArray(int[] arr) {
5+
HashMap<Integer, Integer> map = new HashMap<>();
6+
7+
for (int i : arr) map.put(i, map.getOrDefault(i, 0) + 1);
8+
for (int i : map.keySet()) {
9+
if (map.get(i) % 2 != 0) return false;
10+
}
11+
return true;
12+
}
13+
}

0 commit comments

Comments
 (0)