Skip to content

Instantly share code, notes, and snippets.

# ueeueeuu
# crossum 34
def cross_sum(n)
return n.to_s.chars.map(&:to_i).reduce(:+)
end
def check_pattern(n)
check = true
d1, d2, d3, d4, d5, d6, d7, d8 = n.to_s.split('').map { |digit| digit.to_i }