I am trying to solve a problem where I need to find the airport code in an array of arrays of that represents the starting point of a multi-city flight plan. For example: Given
sorry i, have no enough time to explain my code - but i think nothing is such difficult not to figure out what is happening :)
here is the working example
def find_start_point(list)
start = []
finish = []
list.each do |l|
start.push(l[0])
finish.push(l[1])
end
start.each do |st|
if !finish.include? st
return start.index(st)
end
end
end