摘要:
Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example,MovingAverage m = new Mo 阅读全文
摘要:
In the "100 game," two players take turns adding, to a running total, any integer from 1..10. The player who first causes the running total to reach o 阅读全文
摘要:
Given an array of numbers, verify whether it is the correct preorder traversal sequence of a binary search tree. You may assume each number in the seq 阅读全文
摘要:
This is a follow up of Shortest Word Distance. The only difference is now you are given the list of words and your method will be called repeatedly ma 阅读全文
摘要:
This is a follow up of Shortest Word Distance. The only difference is now word1 could be the same as word2. Given a list of words and two words word1 阅读全文
摘要:
Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. For example,Assume that words = 阅读全文
摘要:
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. Note: The algorithm should run in linear time and in O(1) spa 阅读全文
摘要:
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
摘要:
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
摘要:
Given an integer n, return the number of trailing zeroes in n!. Example 1: Example 2: Note: Your solution should be in logarithmic time complexity. 给一 阅读全文