Amortized Time with Hash Table
问题 I solved the first part of the question but stuck at the second part. I have an elevator and want to support the following: Init() Set the elevator to start from floor 0 and its travel direction to be up (This function is called only once and the direction can't be changed). O(1) AddStop(K) save into the DS that elevator should stop when it reaches floor k. O(log n) while n is the total number of stops for the elevator. NextStop() send the elevator to its next stop position, if it's in the