You are viewing a single comment's thread. Return to all comments →
map<int,vector<int>> constumers; for(int i= 0; i < orders.size();i++){ int result = orders[i][0] + orders[i][1]; constumers[result].push_back(i+1); } vector<int> finalOrder; for(auto prio : constumers){ for(auto costumer : prio.second){ finalOrder.push_back(costumer); } } return finalOrder;
Jim and the Orders
You are viewing a single comment's thread. Return to all comments →
C++