class No203 def initialize @str1 = gets.chomp.to_s.split("") @str2 = gets.chomp.to_s.split("") @continuity = Array.new @count = 0 end def x_or_o(strs) strs.each do |str| if str == "x" @continuity << @count @count = 0 else @count += 1 end end @continuity << @count end def run self.x_or_o(@str1) self.x_or_o(@str2) puts @continuity.max end end no203 = No203.new no203.run