Compute minimum rooms for time intervals | Google Interview Question