C++ 20ms solution using priority_queue


  • 0
    F

    As title indicates, I use priority queue to solve this one, actually, my solution is quite like "sort pair according to sum of pair <u, v>, where u belongs to nums1, v belongs to nums2." In another words, if you remove the constraints of k, then my solution could be extended to some problem like "pair sort".

    0_1469685124156_desk.jpg image )


Log in to reply
 

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