class Solution(object):
    def reconstructQueue(self, people):
        """
        :type people: List[List[int]]
        :rtype: List[List[int]]
        """
        if not people: return []
        people = sorted(people, key=lambda (h, k): (-h, k))
        print people
        res = []
        for p in people:
            res.insert(p[1], p)
        return res


990afe861b44a7b974e04f5e26c6764256fe80c3
class Solution(object):
    def reconstructQueue(self, people):
        """
        :type people: List[List[int]]
        :rtype: List[List[int]]
        """
        if not people: return []
        people = sorted(people, key=lambda (h, k): (-h, k))
        print people
        res = []
        for p in people:
            res.insert(p[1], p)
        return res

