You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation video here : https://youtu.be/ISg5mFFafws
vector<int> jimOrders(vector<vector<int>> orders) { vector<vector<int>> temp; for(int i = 0; i < orders.size(); i++){ int deliver = orders[i][0] + orders[i][1]; temp.push_back({deliver, i+1}); } sort(temp.begin(), temp.end()); vector<int> result; for(auto element: temp)result.push_back(element[1]); return result; }
Seems like cookies are disabled on this browser, please enable them to open this website
Jim and the Orders
You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation video here : https://youtu.be/ISg5mFFafws