Showing 11 questions
You are given two lists of words. Find the number of words that appear exactly once in each of the two lists.
#1. Count Common Words With One Occurrence
Simulate a robot's movement on an infinite grid based on a sequence of commands and obstacles. Determine the square of the robot's final Euclidean distance from the origin.
#2. Walking Robot Simulation
You are given an array and want to minimize the time to make its sum at most a given value. You can reorder the array elements strategically to achieve this minimum time.
#3. Minimum Time to Make Array Sum At Most x
You're given two integers. Simply calculate and return their sum.
#4. Add Two Integers
Design a data structure that efficiently determines if any string ending in the current stream of characters is a word in a given dictionary. Implement a query function that checks for this condition.
#5. Stream of Characters
You are given two non-negative integers represented as strings. Your task is to add these two strings together and return the sum, also as a string.
#6. Add Strings
Simulate the basic operations of a text editor. Implement functions to add text, delete characters, and move the cursor.
#7. Design a Text Editor
Find the longest string that is a prefix of all strings in a given array. If no common prefix exists, return an empty string.
#8. Longest Common Prefix
Simulate an order processing system with a backlog of buy and sell orders. Determine the total number of orders remaining in the backlog after processing them in a specific manner.
#9. Number of Orders in the Backlog
You are given equations represented by pairs of variables and their corresponding values. Your task is to evaluate queries based on these equations, determining the value of expressions if possible, or returning -1.0 if not.
#10. Evaluate Division
Given an array representing the height of bars, calculate how much water can be trapped between them after rain. Think about finding the maximum height to the left and right of each bar.
#11. Trapping Rain Water