This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 } |