Skip to content

Commit

Permalink
Added solution for Sort the People
Browse files Browse the repository at this point in the history
  • Loading branch information
Blacknahil committed Dec 26, 2023
1 parent c5a72b8 commit 5945c3a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions week4/sort-the-people.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Solution:
def sortPeople(self, names: List[str], heights: List[int]) -> List[str]:
return [n for n, h in sorted(zip(names, heights), key=lambda x: x[1], reverse=True)]

#one liner


0 comments on commit 5945c3a

Please sign in to comment.