Accepted python one liner heaqpq.merge


  • 0
    T

    One liner in python using heapq.merge

        def kthSmallest(self, matrix, k):
            return next(itertools.islice((heapq.merge(*matrix)),k-1,k))
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.