返回list數組中兩個數和爲0的組合 Python實現

#!/usr/bin/env python # -*- coding: utf-8 -*- # @File : ali.py # @Author: LiZhigen # @Date : 2018/6/29 # @Desc :[-1,0,1,5,2,-4,4,9,0,-8,-9] 返回[[9, -9], [4, -4], [1, -1], [0, 0]] # 思路: # 一、將數組元素排序; #
相關文章
相關標籤/搜索