Skip to content

Instantly share code, notes, and snippets.

Avatar

Zack Wilder zwilderrr

View GitHub Profile
View gist:4a7929fedf15649d23779c4a0e7e114f
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
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?