Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2016 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/10ace6008899993834d1956660aea8e6 to your computer and use it in GitHub Desktop.
Save anonymous/10ace6008899993834d1956660aea8e6 to your computer and use it in GitHub Desktop.
#!/bin/ruby
arr = Array.new()
array = Array.new()
sum = 0
i = 0
new = []
for k in 1..6
x = gets.chomp
x = x.split(" ")
x.delete(" ")
x = x.map(&:to_i)
arr << x
end
arr.each do |x|
x.each do |y|
y.to_i
new << y
end
end
while i < 7
i += 1
sum += new.max
new.delete_at(new.index(new.max))
end
puts sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment