摘要:
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 complet 阅读全文
摘要:
On a 2x3 board, there are 5 tiles represented by the integers 1 through 5, and an empty square represented by 0.A move consists of choosing 0 and a 4- 阅读全文
摘要:
We have a grid of 1s and 0s; the 1s in a cell represent bricks. A brick will not drop if and only if it is directly connected to the top of the grid, 阅读全文
摘要:
Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
摘要:
This question is about implementing a basic elimination algorithm for Candy Crush.Given a 2D integer array board representing the grid of candy, diffe 阅读全文
摘要:
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs 阅读全文
摘要:
Given a string, find the length of the longest substring T that contains at most k distinct characters.Example 1:Input: s = "eceba", k = 2Output: 3Exp 阅读全文
摘要:
Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements a 阅读全文
摘要:
Design a hit counter which counts the number of hits received in the past 5 minutes.Each function accepts a timestamp parameter (in seconds granularit 阅读全文
摘要:
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 阅读全文