Blend | phone screen
Anonymous User
811

Find the minimum waiting time for a passenger to wait for an elevator inside building with N elevators.

public enum DIRECTION {
	NONE, UP, DOWN
}

class Elevator {
	int sourceFloor;
	int destinationFloor:
	DIRECTION direction;
}

//Input to the function are list of elevators, passenger target floor and direction(up/down) he/she wants to go. 
minWaitTime(List<Elelvator> elevators,int targetFloor,DIRECTION direction) {

}
Comments (1)