Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 831 Bytes

_2418. Sort the People.md

File metadata and controls

31 lines (21 loc) · 831 Bytes

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : July 22, 2024

Last updated : July 22, 2024


Related Topics : Array, Hash Table, String, Sorting

Acceptance Rate : 85.06 %


Solutions

Python

class Solution:
    def sortPeople(self, names: List[str], heights: List[int]) -> List[str]:
        return [x for x, h in sorted(zip(names, heights), key=lambda y: y[1], reverse=True)]