Showing 3 of 28 questions
Find the longest string that is a prefix of all strings in a given array. If no common prefix exists, return an empty string.
#1. Longest Common Prefix
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
Given an array and a maximum allowed difference, find the longest subarray where the most frequent element appears at least the same number of times as all other elements combined. You can change elements by at most the allowed difference amount to achieve this.
#3. Find the Longest Equal Subarray