Showing 15 questions
Imagine hamsters lined up in a row! You need to place food buckets so every hamster gets fed, but buckets can't be next to each other or next to houses. Find the fewest buckets you need.
#1. Minimum Number of Food Buckets to Feed the Hamsters
You're planning a trip and need to buy tickets for specific travel days. Given the costs for 1-day, 7-day, and 30-day passes, determine the minimum total cost to cover all your travel days.
#2. Minimum Cost For Tickets
Simulate addition with base -2 using the given arrays representing two negabinary numbers. Return the result as a negabinary array, ensuring no leading zeros.
#3. Adding Two Negabinary Numbers
You're given the sums of columns in a 2-row binary matrix and the row sums. Your task is to reconstruct a possible binary matrix that satisfies these constraints.
#4. Reconstruct a 2-Row Binary Matrix
Find two numbers in a given array that add up to a specific target value, and return their indices. Essentially, you need to efficiently locate the pair that satisfies the sum requirement.
#5. Two Sum
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.
#6. LRU Cache
Given a list of daily temperatures, find how many days you have to wait until a warmer temperature. Return a list where each element represents the waiting days for each day's temperature.
#7. Daily Temperatures
Given an absolute file path (Unix style), simplify it by resolving redundant separators, directory names, and navigating back up the directory structure. Return the simplified canonical path.
#8. Simplify Path
Find the length of the longest substring within a given string that contains no repeating characters. The substring must be contiguous.
#9. Longest Substring Without Repeating Characters
You are given a list of accounts where each account has a name and a list of email addresses. Your task is to merge accounts belonging to the same person based on shared email addresses.
#10. Accounts Merge
You're given a number in its binary form. Determine the number of steps to reduce it to one by repeatedly dividing by two (if even) or adding one (if odd).
#11. Number of Steps to Reduce a Number in Binary Representation to One
Determine if a string containing parentheses is valid. A valid string has matching and properly nested opening and closing parentheses.
#12. Valid Parentheses
Find the longest palindromic substring within a given string. A palindromic substring reads the same forwards and backward.
#13. Longest Palindromic Substring
Determine the total number of continuous subarrays within a given array that sum up to a specific target value, k.
#14. Subarray Sum Equals K
You are a robber planning to rob houses along a street. Maximize your loot, but be careful - adjacent houses have connected security systems that will trigger an alarm if you rob them both.
#15. House Robber