Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int key, value;
- if (initials == "PUT") {
- size_t space1 = query.find(' ', 4);
- key = std::stoi(query.substr(4, space1 - 4));
- value = std::stoi(query.substr(space1 + 1));
- LFUObject.put(key, value);
- } else { // GET query
- key = std::stoi(query.substr(4));
- int getAns = LFUObject.get(key);
- ans.push_back(getAns);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement