18 lines
280 B
Ruby
18 lines
280 B
Ruby
|
#prepare the input which is a string containing new lines
|
||
|
def parse(input)
|
||
|
data = []
|
||
|
input.each_line do |line|
|
||
|
data << line
|
||
|
end
|
||
|
data
|
||
|
end
|
||
|
|
||
|
# result should a single string or integer
|
||
|
def calculate(data)
|
||
|
result = ""
|
||
|
data.each do |d|
|
||
|
result = d
|
||
|
end
|
||
|
result
|
||
|
end
|