update 406 根据身高重建队列: 移除Pyhton版本的冗余代码

This commit is contained in:
Jijie LIU
2021-06-22 17:22:42 +02:00
parent ab002e7a30
commit 1f813d446f

View File

@ -214,13 +214,10 @@ Python
```python
class Solution:
def reconstructQueue(self, people: List[List[int]]) -> List[List[int]]:
people.sort(key=lambda x: (x[0], -x[1]), reverse=True)
people.sort(key=lambda x: (-x[0], x[1]))
que = []
for p in people:
if p[1] > len(que):
que.append(p)
else:
que.insert(p[1], p)
que.insert(p[1], p)
return que
```