Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. lRUCache.put(1, 1); // cache is {1=1} lRUCache.put(2, 2); // cache is {1=1 ...
この記事は note株式会社 Advent Calendar 2022の 15 日目の記事です。 LeetCode はプログラミング問題の対策サイトだというのが専らの紹介文だと思うんだけど、別にそれだけに限定した使い方じゃなくても十分楽しいサービスだよ、という話をしたい。 LeetCodeとは ...
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the value (will always be positive) of the key if the ...
LeetCodeを今年中に100問解くという目標をたててから、約3ヶ月。現在50問解くことに成功したので、一回振り返りをしてみようと思います。 メンターに勧められたからというのが一番大きいのですが、CSを専攻していない自分に足りないプログラミングの考え ...