坏气十足 发表于 2018-8-9 08:42:40

数组拆分 I array-partition leetcode python-fox64194167的博客

class Solution(object):  
    def arrayPairSum(self, nums):
  
      """
  
      :type nums: List
  
      :rtype: int
  
      """
  
      listNum = list(nums)
  
      listNum.sort()
  
      sum = 0
  
      for i in range(0, len(listNum), 2):
  
            sum += listNum
  
      return sum
页: [1]
查看完整版本: 数组拆分 I array-partition leetcode python-fox64194167的博客