Showing 3 of 13 questions
Simulate a simple bank system that supports basic operations like deposit, withdraw, and check balance for different accounts. You will implement methods to handle these transactions and ensure validity based on account balances and existence.
#1. Simple Bank System
Design a data structure that acts as a Least Recently Used (LRU) cache. Implement methods to get and put key-value pairs, evicting the least recently used entry when the cache is full.
#2. LRU Cache
Find all nodes in a binary tree that are exactly K distance away from a given target node. The distance is measured by the number of edges between the nodes.
#3. All Nodes Distance K in Binary Tree