Skip to content

Commit 1f6b90f

Browse files
committed
Runtime: 1769 ms (Top 5.17%) | Memory: 16.6 MB (Top 56.95%)
1 parent a958ac2 commit 1f6b90f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/A/Array of Doubled Pairs/Array of Doubled Pairs.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# Runtime: 1769 ms (Top 5.17%) | Memory: 16.6 MB (Top 56.95%)
12
class Solution:
23
def canReorderDoubled(self, arr: List[int]) -> bool:
34
n = len(arr)
45
arr.sort()
56
times = n//2
67
count = {}
7-
for i in arr :
8+
for i in arr :
89
if i in count:count[i] += 1
910
else: count[i] = 1
1011
for i in count:
@@ -23,4 +24,4 @@ def canReorderDoubled(self, arr: List[int]) -> bool:
2324
count[i] = ct1
2425
count[i*2] = ct2
2526
if times == 0:return True
26-
return False
27+
return False

0 commit comments

Comments
 (0)