class Solution(object):
def minMoves2(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l,r ,count = 0,len(nums)-1,0
nums.sort()
while l<r:
count+=nums[r]-nums[l]
l+=1
r-=1
return count
def minMoves2(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
l,r ,count = 0,len(nums)-1,0
nums.sort()
while l<r:
count+=nums[r]-nums[l]
l+=1
r-=1
return count