Skip to content

Commit 899fa9a

Browse files
My solution to 2418
1 parent ed942f3 commit 899fa9a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

problems/2418/jeremymanning.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# [Problem 2418: Sort the People](https://leetcode.com/problems/sort-the-people/description/?envType=daily-question)
22

33
## Initial thoughts (stream-of-consciousness)
4-
5-
## Refining the problem, round 2 thoughts
4+
- I think this is just a one-liner...I'm just going to code it
65

76
## Attempted solution(s)
87
```python
9-
class Solution: # paste your code here!
10-
...
8+
class Solution:
9+
def sortPeople(self, names: List[str], heights: List[int]) -> List[str]:
10+
return [x[0] for x in sorted(zip(names, heights), key=lambda p: p[1], reverse=True)]
1111
```
12+
- Given test cases pass
13+
- Submitting...
14+
15+
![Screenshot 2024-07-21 at 10 34 36 PM](https://github.com/user-attachments/assets/0f148d81-5308-470a-9c39-233e40716304)
16+
17+
Solved!

0 commit comments

Comments
 (0)