Skip to content

Instantly share code, notes, and snippets.

@lgranger
Created December 10, 2015 18:35
Show Gist options
  • Save lgranger/1fe57734519b66f81284 to your computer and use it in GitHub Desktop.
Save lgranger/1fe57734519b66f81284 to your computer and use it in GitHub Desktop.
def watch_two_movies(flight_length, movie_length)
movie_length.sort!
if movie_length[0] + movie_length[1] > flight_length
x = false
end
movie_length.each do |movie|
if movie_length.include?(flight_length - movie)
x = true
end
end
case x
when false
return false
else
return true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment