#include <queue>;
#include <vector>;
using namespace std;
class SortSecondary {
public:
bool operator()(vector<int> below, vector<int> above)
{
if (below[1] < above[1]) {
return true;
}
return false;
}
};
class Solution {
public:
int maximumUnits(vector<vector<int>>& boxTypes, int truckSize) {
int resp = 0;
while(!maxHeap.empty() && truckSize > 0) {
vector<int> thisBoxSet = maxHeap.top();
maxHeap.pop();
int numBoxes = thisBoxSet[0];
int boxUnits = thisBoxSet[1];
while(numBoxes > 0 && truckSize >= 1) {
numBoxes--;
truckSize -= 1;
resp += boxUnits;
}
}
return(resp);
}
};