Problem :

https://leetcode.com/problems/queue-reconstruction-by-height/


My Solution :

class Solution:
    def reconstructQueue(selfpeople):
        people.sort(key=lambda x: (-x[0], x[1]))
        ans = []
        for h, k in people:
            ans.insert(k, (h, k))
        return ans