Skip to content

Instantly share code, notes, and snippets.

@claytonflesher
Created May 16, 2015 16:46
Show Gist options
  • Save claytonflesher/f64600d9013e0b0bb5f3 to your computer and use it in GitHub Desktop.
Save claytonflesher/f64600d9013e0b0bb5f3 to your computer and use it in GitHub Desktop.
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