Created
May 16, 2015 16:46
-
-
Save claytonflesher/f64600d9013e0b0bb5f3 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 find_largest(numbers) | |
master_list = Array.new | |
list = numbers.permutation.to_a | |
list.map do |l| | |
master_list << l.join | |
end | |
master_list.sort.last | |
end | |
numbers = [1, 20, 3, 49, 442] | |
puts find_largest(numbers) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment