Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » Forum » x-Forum » Question

LRU Cache proglem

Hi,

Can someone pls help in solving the LRU Cache problem.

Problem URL - https://www.interviewbit.com/problems/lru-cache/

Design and implement a data structure for LRU (Least Recently Used) cache. It should support the following operations: get and set.

get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
set(key, value) - Set or insert the value if the key is not already present. When the cache reaches its capacity, it should invalidate the least recently used item before inserting the new item.
The LRU Cache will be initialized with an integer corresponding to its capacity. Capacity indicates the maximum number of unique keys it can hold at a time.

Posted by myralyons 2018-10-29 01:04:50

XRumer 19.0 + XEvil 4.0: NEW innovative programm for solving any Captcha 
 
1. Powerful Neuronetworks: XEvil OCR can solve more than 12000 of different types of Captcha's, 
including such of popular, like Google ReCaptcha v2, v3 (in XEvil 4.0 Ultra only!), CaptchaCom, SolveMedia, Bing-Captcha, 
Facebook-captcha and Ucoz-captcha, Yandex-captcha, DLE-captcha, VBulletin-Captcha, and a lot of other types! 
 
2. Very High speed and precision: recognition speed 0.01 .. 0.02 second per image (but only 1 second in DEMO version!), 
XEvil can bypass and solve wide types of captcha with high precision, 
without depending of difficulty, distortion, noises, fonts, colors. 
 
Exception is Google ReCaptcha-2, about 20-30 seconds per solution: 
on ReCaptcha-2 need to click a lot of images inside with a special delay. 
 
3. Very simple UI: just 3 main buttons to start recognition, 
so it's  easy to use with a wide spectre programs of SEO, SMM, Analytics, Mass Auto-Registering, Posting, Mass Sending, Parsing, CryptoCurrency Mining programs. 
 
Interested? ;) 
Just do search in google "XEvil for Free". 
Free DEMO version is available! 
 
Thank you for your attention! ;)

C++ user image BoobiesdootoZJ posted 2020-02-22 03:24:40

Can we place advertisement of our service on your website? 
What price?

C++ user image ThomasraWBS posted 2020-02-25 12:58:18

Can we place advertisement of our service on your website? 
What price?

C++ user image ThomasraWBS posted 2020-02-26 04:51:12

Can we place advertisement of our service on your website? 
What price?

C++ user image ThomasraWBS posted 2020-02-27 02:21:17

Can we place advertisement of our service on your website? 
What price?

C++ user image ThomasraWBS posted 2020-02-28 03:17:22

Can we place advertisement of our service on your website? 
What price?

C++ user image ThomasraWBS posted 2020-02-28 13:56:12

Anybody home? :)

C++ user image KristinaHepMB posted 2020-03-18 02:37:08

Your Answer


Ask New Question