Advertisement
asdfg0998

cd

Nov 5th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. int key, value;
  2. if (initials == "PUT") {
  3.     size_t space1 = query.find(' ', 4);
  4.     key = std::stoi(query.substr(4, space1 - 4));
  5.     value = std::stoi(query.substr(space1 + 1));
  6.     LFUObject.put(key, value);
  7. } else { // GET query
  8.     key = std::stoi(query.substr(4));
  9.     int getAns = LFUObject.get(key);
  10.     ans.push_back(getAns);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement