Implement a function that merges multiple sorted integer streams into a single sorted list. interface SortedIntegerStream { int next(); // get the integ…
A new restaurant in my hometown gets most of its income from a few important clients. I want to model the probability that a client comes to my restaura…
You are given an array Parkings of size N , which represents parking spaces, and an integer K , which represents the number of cars you need to park in…
Imagine that each state is assigned a number of votes as follows: Alabama = 9 Alaska = 3 Arizona = 11 Arkansas = 6 … Wyoming = 3 For the purpose of th…
Climbing Stairs Description You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many di…
RichText Formatting When displaying text at Scale, we want to be able to store and display richtext : text that has formatting like bold, italic, etc. F…
Assume we have a Node class with: int val Node right Node left Input: binary tree of ints (you’ll be given root node) Return the boundary traversal of t…
Given a string s consisting of lowercase English characters, determine if you can make it a palindrome by removing at most one letter. Example 1: Input:…
We are writing software to collect and manage data on how fast racers can complete obstacle courses. An obstacle course is a series of difficult physica…
You are planning a trek across a snowy mountain. On the mountain, it snows in the morning, the snow melts with the sun in the afternoon, and in the even…
Run Tests Background Often at Google, there are tests that are resource intensive and long-running, which makes them difficult to use as pre-submit test…
Given an array of strings (terms), find the number of occurrences of each term in a string. You need only fill out the Count method. Parameters: Use any…
There is a single direction linked list. Please give the 50th element from the end of the given list. 这道题考察的是单向链表的倒数第 k 个节点查找,核心思路通常是双指针:先让快指针向前走 50 步,然…
Determine if an undirected graph has cycle. Example 1: [[1,2],[1,3],[2,3]] -> return true Example 2: [[1,2],[2,3],[3,4],[1,5]] -> return false 这道题要求判断一个…
We are given an array asteroids of integers representing asteroids in a row. The indices of the asteroids in the array represent their relative position…
A multiset (also known as a bag) is a mutable, unordered collection of distinct objects that may appear more than once in the collection. Implement a mu…