Queue Reconstruction by Height
- sort people:
- in the descending order by height
- among the guys of the same height, in the ascending order by k-values
- take guys one by one, and place them in the output array at the indexes equal to their k-values.
- return output array.
def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]: res =  people.sort(key = lambda elt: (-elt, elt)) for person in people: res.insert(person, person) return res