随笔分类 - Level 1
摘要:Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s
        阅读全文
                
摘要:Suppose we have very large sparse vectors (most of the elements in vector are zeros) Find a data structure to store them Compute the Dot Product. Foll
        阅读全文
                
摘要:Given two binary search trees root1 and root2. Return a list containing all the integers from both trees sorted in ascending order. Example 1: Input: 
        阅读全文
                
摘要:Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Exa
        阅读全文
                
摘要:In an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The order of the alphabet is some permu
        阅读全文
                
摘要:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o
        阅读全文
                
摘要:Error Retries and Exponential Backoff in AWS https://docs.aws.amazon.com/general/latest/gr/api-retries.html Numerous components on a network, such as 
        阅读全文
                
摘要:Recurrence Algorithm Big-Oh Solution T(n) = T(n/2) + O(1) Binary SearchO(log n)T(n) = T(n-1) + O(1) Sequential SearchO(n)T(n) = 2 T(n/2) + O(1) Tree T
        阅读全文
                
摘要:Design and implement a data structure for a compressed string iterator. It should support the following operations: next and hasNext. The given compre
        阅读全文
                
摘要:Find the second largest node in the BST 分析: 如果root有右节点,很明显第二大的node有可能在右子树里。唯一不满足的条件就是右子树只有一个node. 这个时候root就是第二大node. 所以我们需要把root(可能是第二大node)也传下去。 如果ro
        阅读全文
                
摘要:Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Examp
        阅读全文
                
摘要:In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as
        阅读全文
                
摘要:Whenever you expose a web service / api endpoint, you need to implement a rate limiter to prevent abuse of the service (DOS attacks). Implement a Rate
        阅读全文
                
摘要:Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in t
        阅读全文
                
摘要:An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr, 
        阅读全文
                
摘要:Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or
        阅读全文
                
摘要:Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's
        阅读全文
                
摘要:Given a non-negative integer numRows, generate the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers
        阅读全文
                
摘要:Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the
        阅读全文
                
摘要:Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l
        阅读全文
                
                    
                
浙公网安备 33010602011771号