Skip to content

Commit 0fcceb5

Browse files
committed
Mar 17
1 parent e4c3cfe commit 0fcceb5

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Solution:
2+
def divideArray(self, nums: list[int]) -> bool:
3+
seen = set()
4+
for num in nums:
5+
if num in seen:
6+
seen.remove(num)
7+
else:
8+
seen.add(num)
9+
return not seen
10+
11+
12+
def main():
13+
nums = [3, 2, 3, 2, 2, 2]
14+
assert Solution().divideArray(nums) is True
15+
16+
nums = [1, 2, 3, 4]
17+
assert Solution().divideArray(nums) is False
18+
19+
20+
if __name__ == '__main__':
21+
main()

2025-03-March-LeetCoding-Challenge/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
| March 14 | [2226. Maximum Candies Allocated to K Children](https://leetcode.com/problems/maximum-candies-allocated-to-k-children/) | Medium | Solved |
2121
| March 15 | [2560. House Robber IV](https://leetcode.com/problems/house-robber-iv/) | Medium | Unsolved |
2222
| March 16 | [2594. Minimum Time to Repair Cars](https://leetcode.com/problems/minimum-time-to-repair-cars/) | Medium | Unsolved |
23-
| March 17 | []() | | |
23+
| March 17 | [2206. Divide Array Into Equal Pairs](https://leetcode.com/problems/divide-array-into-equal-pairs/) | Easy | Solved |
2424
| March 18 | []() | | |
2525
| March 19 | []() | | |
2626
| March 20 | []() | | |
@@ -40,6 +40,6 @@
4040
## Summary
4141
| Level | Problems | Solved | Unsolved |
4242
| --- | --- | --- | --- |
43-
| Easy | 5 | 5 | 0 |
43+
| Easy | 6 | 6 | 0 |
4444
| Medium | 11 | 5 | 6 |
4545
| Hard | 0 | 0 | 0 |

0 commit comments

Comments
 (0)