Jim and the Orders

  • + 0 comments

    vector jimOrders(vector> orders) { vector> sum; int i = 1;

    for(auto it : orders){
        int order = it[0];
        int prep = it[1];
        sum.push_back({order + prep, i});
        i++;
    }
    sort(sum.begin(),sum.end());
    
    vector<int> ans;
    
    for(auto it : sum){
        ans.push_back(it.second);
    }
    
    return ans;
    

    }