Skip to content

Commit cdc3318

Browse files
authored
Update 406.根据身高重建队列.py
1 parent 699a5ad commit cdc3318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# 先按升高降序排序,身高相同则按k升序排序。再以k为索引插入排序
1+
# 先按身高降序排序,身高相同则按k升序排序。再以k为索引插入排序
22
class Solution(object):
33
def reconstructQueue(self, people):
44
people.sort(key=lambda x:(-x[0], x[1]))
55
res = []
66
for p in people:
77
res.insert(p[1], p)
8-
return res
8+
return res

0 commit comments

Comments
 (0)