# 谷歌店面

https://leetcode.com/problems/random-pick-with-weight/ 很类似的题，先写了一遍最直接的只pick一次，follow up是pick k次再写了一遍，用TreeMap或者binary search都

Parallel Job Scheduling

There are N processes with some processes having dependencies on other processes (meaning if a process P1 is dependent on process P2, then P1 can only be started after P2 is complete). Assume that there won’t be a cyclic dependency in the inputs.

Each process has a time duration (in sec) given by Duration array.

Processes can be run in parallel. We need to find the minimum time such that all processes are completed.

TestCase:
There are 4 processes -
A (Duration: 2 sec), B (Duration: 3 sec), C (Duration: 4 sec) and D (Duration: 5 sec)

B is dependent on A
C is dependent on A
D is dependent on B & C

In this case, min time would be 11 sec.

2。股票价格， 实现历史最小， 最大， 以及当前价格 和 更新价格4个functions‍‍‌‌‌‌‍‍‍‍‌‌‍‍‍‍‌‍‍. O(1)

1: 實現Set(int index, int value), Get(int index), SetAll(int value)三個function，但時間複雜度必須滿足O(1)

2. 給一個一維數組，接著必須按照數組的大小順序重新給值，並從1開始給值
ex: [20, 10, 30, 40] -> [2, 1, 3, 4]