Python (sort and insert)


  • 0
    J
            res = []
            people = sorted(people, key = lambda x: (-x[0], x[1]))
            for i in people:
                res.insert(i[1], i)
            return res
    

Log in to reply
 

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