Showing 3 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
Find the k most frequent elements in a given array of numbers. Return the top k elements based on their frequency.
#2. Top K Frequent Elements
Find all starting indices of substring(s) in a given string that are formed by the concatenation of all words from a provided list, where each word must appear exactly once and without any intervening characters.
#3. Substring with Concatenation of All Words