Skip to content

Commit 633b9f0

Browse files
authored
Create Array Partition.py
1 parent 7853167 commit 633b9f0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

Array Partition.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Solution(object):
2+
def arrayPairSum(self, nums):
3+
"""
4+
:type nums: List[int]
5+
:rtype: int
6+
"""
7+
nums.sort()
8+
z = len(nums)
9+
sum1 = 0
10+
for i in range(0,z):
11+
if (i%2 == 0):
12+
sum1 += nums[i]
13+
return sum1

0 commit comments

Comments
 (0)