Find K Pairs with Smallest Sums.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:leetcode 作者: hustlrr 项目源码 文件源码
def kSmallestPairs(self, nums1, nums2, k ):
        """
        :type nums1: List[int]
        :type nums2: List[int]
        :type k: int
        :rtype: List[List[int]]
        """
        return min(list, heapq.nsmallest(k, itertools.product(nums1, nums2), key=sum))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号