Link to the code: https://pastebin.com/KvSHwzAJ
Link to the question: https://leetcode.com/problems/lru-cache/
*Complexity Analysis*
Time complexity: O(1) both for put and get.
Space complexity: O(capacity) since space is used only for a hashmap and double linked list with at most capacity + 1 elements.
SUPPORT MY WORK BY SUBSCRIBING TO THE CHANNEL :
/ @akshaygoyal2134
LeetCode Playlist: • Prison Cells After N Days | prison cells a...