Showing 3 of 50 questions
Find the largest rectangular area that can fit within a histogram defined by an array of bar heights. You are given an array representing the height of bars, where each bar has a width of 1.
#1. Largest Rectangle in Histogram
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
The problem involves decoding a string that follows a specific encoding rule: k[encoded_string], where the encoded_string inside the square brackets is repeated exactly k times. Your task is to decode the string and return the decoded string.
#3. Decode String