Showing 10 questions
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.
#1. Decode String
You're given a graph, and your task is to create a completely independent copy of it. Ensure the cloned graph has the same structure and node values as the original.
#2. Clone Graph
Design a key-value store that supports storing values with timestamps. You should be able to retrieve the latest value for a key that's less than or equal to a given timestamp.
#3. Time Based Key-Value Store
Design a calendar system. You need to implement a function to book new events, but avoid double booking (overlapping events).
#4. My Calendar I
Given a string of digits, return all possible letter combinations that the number could represent, using the typical phone keypad mapping. The goal is to generate all valid combinations in any order.
#5. Letter Combinations of a Phone Number
You're given a bag of tokens and an initial power. You can strategically trade power for points (and vice-versa) to maximize your score by playing tokens face-up or face-down.
#6. Bag of Tokens
Find the length of the longest strictly increasing subsequence within a given array of numbers. A subsequence doesn't need to be contiguous, but the elements must maintain their original order.
#7. Longest Increasing Subsequence
Determine if a given string represents a valid IPv4 or IPv6 address. You need to check if the string conforms to the rules for either type of IP address.
#8. Validate IP Address
You're given information about servers and requests. Determine how many servers received zero requests based on the provided time intervals for the requests.
#9. Count Zero Request Servers
Find the number of contiguous subarrays within a given array whose product is strictly less than a target value k. The goal is to efficiently count these subarrays by considering the product of their elements.
#10. Subarray Product Less Than K