CREATED TIME: Jan 19, 2020 4:06 PM UPDATED TIME: Jan 19, 2020 4:06 PM 난이도: Medium
bool cmp(const vector
class Solution {
public:
vector<vector<int>> reconstructQueue(vector<vector<int>>& people) {
sort(people.begin(), people.end(), cmp);
vector<vector<int>> res;
for(auto &a : people){
res.insert(res.begin()+a[1], a);
}
return res;
}
};