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…
Implement Connect6 . Connect6 is a simple board game similar to tic-tac-toe. There are two players, black and white, who alternate turns placing their c…
Best Friend Best friend: is a friend in one’s list who likes his content the most. Using Jack as an example, Jack likes Rachel’s post 5 times, but 0 for…
Find first non-repeated character in a string. Examples: AAABBBC , returns C . AAABBBCD , returns C . ABABABCD , returns C . 这道题要求在字符串中找出第一个只出现一次的字符,并返回…
Write a function that calculates the dot product of two vectors. 96% of vector components are zero. What is a good data structure for v1 , v2 so that yo…
When someone drags their finger across a phone’s keyboard, we can record the letters they intersected, creating a swype path . Given a swype path and a…
Question description Design and implement a tab component. The component should support switching between multiple tabs and displaying the corresponding…