Skip to content

Instantly share code, notes, and snippets.

@sobinsunny
Created August 8, 2016 18:30
Show Gist options
  • Save sobinsunny/1f4394378ddc8d7f5944ce36e6839869 to your computer and use it in GitHub Desktop.
Save sobinsunny/1f4394378ddc8d7f5944ce36e6839869 to your computer and use it in GitHub Desktop.
problem-2
class SuerScore
def initialize
@row = []
end
def add(value)
@row.push(value.split(" "))
end
def tests(n=2)
output = []
(0..n).each do |i|
output << @row.max_by{ |x| x[i] }[i].to_i
end
puts output
puts output.reduce(:+)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment