fun reconstructQueue(people: Array<IntArray>): List<IntArray> {
//排序 身高从搞到底
Arrays.sort(people) { o1, o2 ->
if (o1[0] != o2[0]) -o1[0] + o2[0] else o1[1] - o2[1]
}
val res: LinkedList<IntArray> = LinkedList()
for (cur in people) {
res.add(cur[1], cur)
for (e in res){
print("people cur :: ${Arrays.toString(e)} .. ")
}
println()
}
return res.toList()
}
题解思路照抄自::https://leetcode-cn.com/problems/queue-reconstruction-by-height/solution/gen-ju-shen-gao-zhong-jian-dui-lie-by-leetcode/