intpop(){ auto res = rend(sizeMap)->second.back(); sizeMap[(int)m[res].size()].pop_back(); if(sizeMap[(int)m[res].size()].empty()) sizeMap.erase((int)m[res].size()); m[res].pop_back(); return res; } };
/** * Your FreqStack object will be instantiated and called as such: * FreqStack* obj = new FreqStack(); * obj->push(x); * int param_2 = obj->pop(); */