Created
December 10, 2015 18:35
-
-
Save lgranger/1fe57734519b66f81284 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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