This file contains hidden or 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
def num_seq(seq) | |
split_seq = seq.to_s.chars.map(&:to_i) | |
index = 0 | |
range = 0 | |
groups = [] | |
until index >= split_seq.length || range >= split_seq.length | |
if both_odd_or_even(split_seq, index, range) | |
range += 1 | |
else | |
groups << split_seq[index..range - 1].join.to_i |
This file contains hidden or 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
def continuous_seq(number) | |
split_num = number.to_s.chars.map(&:to_i) | |
num_arr = [] | |
index = 0 | |
while index < split_num.length | |
chunk = [] | |
repeat = true | |
while repeat | |
if split_num[index].odd? | |
if split_num[index + 1].odd? |