Showing 3 of 63 questions
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.
#1. LRU Cache
Given a string, remove duplicate letters so that each letter appears only once. Ensure the resulting string is the smallest in lexicographical order among all possible results.
#2. Remove Duplicate Letters
Find the lexicographically smallest subsequence of distinct characters from a given string. You need to ensure each character appears only once and the relative order is maintained.
#3. Smallest Subsequence of Distinct Characters