Skip to content

Instantly share code, notes, and snippets.

View zwilderrr's full-sized avatar

Zack Wilder zwilderrr

View GitHub Profile
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?
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