Showing 15 questions
You're given student reports and keywords. Determine the top K students based on how many positive and negative keywords appear in their reports.
#1. Reward Top K Students
Find the maximum value within a sliding window of size k as it moves across an array. You'll need to efficiently update the maximum as the window slides.
#2. Sliding Window Maximum
You are given a file system represented as a list of folder paths. Identify and delete all duplicate folders, keeping only one copy of each unique folder structure.
#3. Delete Duplicate Folders in System
Find the k highest-ranked items in a grid, considering price, distance from a starting point, and item value. The items must fall within a specified price range.
#4. K Highest Ranked Items Within a Price Range
You're given three arrays of numbers. Find the unique numbers that appear in at least two of the three arrays.
#5. Two Out of Three
Imagine a grid of colored cells. You need to recolor the border of a specific region, where the region is defined by connected cells of the same color.
#6. Coloring A Border
You're given a list of flight tickets, each representing a departure and arrival airport. Reconstruct the itinerary by visiting all the airports in the lexicographically smallest order, starting from "JFK".
#7. Reconstruct Itinerary
Convert a given integer into its Roman numeral representation. You need to understand the mapping between integer values and Roman symbols to perform the conversion accurately.
#8. Integer to Roman
Find the area of the largest square that can be formed within a binary matrix containing only 1s and 0s, where the square's sides consist only of 1s.
#9. Maximal Square
Simulate backspace operations on two strings and determine if the resulting strings are equal. Effectively, you need to compare strings after processing backspace characters.
#10. Backspace String Compare
Given a collection of distinct integers, find all possible permutations (orderings) of the elements. Return a list of these permutations.
#11. Permutations
Determine if a string containing parentheses is valid. A valid string has matching and properly nested opening and closing parentheses.
#12. Valid Parentheses
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.
#13. LRU Cache
Given a grid representing land and water, count the number of distinct islands. An island is formed by connected land cells.
#14. Number of Islands
Convert a Roman numeral string into its corresponding integer value. The input string will represent a valid Roman numeral.
#15. Roman to Integer