Showing 3 of 6 questions
Transform one word into another, one letter at a time, using only words from a given dictionary. Find the shortest sequence of words to reach the target.
#1. Word Ladder
You're given a budget and prices for pens and pencils. Determine how many different combinations of buying pens and pencils you can afford within your budget.
#2. Number of Ways to Buy Pens and Pencils
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.
#3. LRU Cache