16. 3Sum Closest

題目 從給出的numbers數組中找出三個數組最接近於目標結果。 討論區代碼 class Solution: # @return an integer def threeSumClosest(self, num, target): num.sort() # 排序 result = num[0] + num[1] + num[2] #前三個
相關文章
相關標籤/搜索