View gist:4a7929fedf15649d23779c4a0e7e114f
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
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 |
View gist:6816aacdbd19595b27d6079c6e7f1a13
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
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? |