NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

(This question is a variation of the LeetCode question 146. LRU Cache. If you haven't completed that question yet, it is recommended to solve it first.)

Design a data structure that implements a Least Recently Used (LRU) Cache with support for dynamic resizing. The cache should allow retrieval, insertion, and capacity adjustment while maintaining the LRU eviction policy.

Test Cases
Input
Output
Expected