Hacker News new | ask | show | jobs
by ghj 2119 days ago
I've implemented this for leetcode without realizing it's paper worthy: https://leetcode.com/problems/lfu-cache/

My implementation: https://pastebin.com/48mMTTdK

I am surprised to see that the paper was only published in 2010. I would expect something this simple to have been discovered earlier. I guess it's easy only after someone tells you constant time is possible.

3 comments

I guess that it's more likely that someone implement an algorithm in an innovative way for its program than it is for one to publish a paper. But yeah maybe there's no blog anterior to the paper which would be surprising but possible.
I came here to say the same thing. I'm not even particularly good at this kind of thing.
I had this on phone screen :D.
Did you get the job?