new_contents: #@author: cchen
  #It will be updated later
  
  class Solution:
      # @return an integer
      def threeSumClosest(self, num, target):
          num.sort()
          mindiff=100000
          res=0
          for i in range(len(num)):
              left=i+1; right=len(num)-1
              while left<right:
                  sum=num[i]+num[left]+num[right]
                  diff=abs(sum-target)
                  if diff<mindiff: mindiff=diff; res=sum
                  if sum==target: return sum
                  elif sum<target: left+=1
                  else: right-=1
          return res
  
subject: Create ThrSumClose_001.py