Merge Intervals Given an array intervals representing a collection of intervals, where each interval is intervals[i] = [start, end] , write a function t…
You are given an array prices where prices[i] is the price of a given stock on the i -th day, and an integer fee representing a transaction fee. Find th…
Question: You are walking on a 2D map contoured with various heights of land that accumulates water when it rains. Specifically, when the rainwater heig…
Given an array of integers nums and an integer target , return indices of the two numbers such that they add up to target . You may assume that each inp…
Query: use the query to match the key. Key: label of each data slice. Value: the data itself. 1. Compute the similarity between query and key. query [1…
Given the standard mapping from English letters to digits on a phone keypad, write a program that outputs all words that can be formed from an n-digit p…
Implement a caching reader for remote file access. A RemoteReader can read bytes from a server by offset and size. Your task is to implement CachingRead…
A = (M, K1) B = (K2, N) Given a util function matmul(X1, X2) , where X1 and X2 can only be tensors of shape (tile_size, tile_size) . Implement tiled_mat…
Given a string s containing just the characters ‘(‘ , ‘)’ , ‘{‘ , ‘}’ , ‘[‘ and ‘]’ , determine if the input string is valid. An input string is valid i…
Light Cells Activation Build a 3×3 grid of light cells (omitting the center cell) where you can click on the cells to activate them, turning them green….
Array a consists of distinct, positive integers and serves as a work array. Array rotate contains a list of integers that define operations on the work…
Problem statement Imagine that you want to schedule a meeting of a certain duration with a coworker. You have access to your calendar and your coworker’…
Complete the finestFoodOutlet function below. The function is expected to return a STRING . The function accepts the following parameters: STRING city I…
Question: Sellers buy items in Walmart during sale events and sell them on Amazon to make money. You have to help a seller make maximum profit for their…
You live in San Francisco city and want to minimize your commute time to the Databricks HQ. Given a 2D matrix of the San Francisco grid and the time as…
Top K Frequent Elements Description: Given a non-empty array of integers, return up to k most frequent elements. For example: Given [1,2,1,1,2,3] and k…
Calculate Shipping Cost Order: { “country”: “US”, // or “CA” for the CA order “items”: [ { “product”: “mouse”, “quantity”: 20 }, { “product”: “laptop”,…