摘要:
A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The 阅读全文
摘要:
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
摘要:
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the u 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
摘要:
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
摘要:
Assume you have an array of length n initialized with all 0's and are given k update operations. Each operation is represented as a triplet: [startInd 阅读全文
摘要:
Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seconds granulari 阅读全文
摘要:
You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. 阅读全文
摘要:
Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. Credi 阅读全文
摘要:
Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals. For exampl 阅读全文