def first_come_first_served?(take_away_orders, eat_in_orders, served_orders)
served_orders.each do |order|
if take_away_orders[0] === order
# match!
take_away_orders.shift()
elsif eat_in_orders[0] === order
# match!
eat_in_orders.shift()
else
# no match, not first-come first-serve
return false
end
end
# check for remaining extra orders
return take_away_orders.concat(eat_in_orders).length == 0 ? true : false
end