|
|
@ -62,15 +62,11 @@ def explode(s, pair_range)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
class Array
|
|
|
|
class Array
|
|
|
|
def magnitude
|
|
|
|
def magnitude = 3*self[0].magnitude + 2*self[1].magnitude
|
|
|
|
3*self[0].magnitude + 2*self[1].magnitude
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
class Integer
|
|
|
|
class Integer
|
|
|
|
def magnitude
|
|
|
|
def magnitude = self
|
|
|
|
self
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# sum = ARGF.read.split("\n").reject(&:empty?).inject {|sum,num| add(sum, num) }
|
|
|
|
# sum = ARGF.read.split("\n").reject(&:empty?).inject {|sum,num| add(sum, num) }
|
|
|
|