注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
两个礼拜前的店面,一开始只给了part 1然后写出来了再给part 2 跟 part 3
面试官人挺好的, 一周之后通知过了约onsite
# ######### PART 1 #########
# We've been asked by an up-and-coming airport to help them quickly and efficiently build daily departure schedules!
# Part 1: Straightforward Schedule
# Before the start of each day, all airliners are required to send in their planned departures for that day. For each flight, the airliners provide three pieces of information: a flight id, a planned departure time, and the number of passengers on each flight. We want to determine if a given schedule is possible (i.e. no scheduling conflicts), and if so, we want to be able to build and return the schedule, ordered from earliest to latest departure.
# Our airport only has one runway. A scheduling conflict is determined by the existence of more than one flight with the same departure time.
# A flight has an id, time, passengers.
# As an example, if this was the set of flights requested for the day:
# United_123, 05:30, 180
# Alaska_475, 14:50, 92
# Alaska_472, 16:00, 48
# Southwest_447, 07:30, 176
# Southwest_847, 15:10, 151
# We would want our scheduler to return an ordered schedule like the following:
# [
# <United_123, 05:30, 180>,
# <Southwest_447, 07:30, 176>,
# <Alaska_475, 14:50, 92>,
# <Southwest_847, 15:10, 151>,
# <Alaska_472, 16:00, 48>,
# ]
# ######### PART 2 #########
|