You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
299 B
19 lines
299 B
4 days ago
|
available, desired = DATA.read.split("\n\n")
|
||
|
available = available.split(", ")
|
||
|
desired = desired.lines(chomp: true)
|
||
|
|
||
|
available = Regexp.new("^(#{available.join(?|)})+$")
|
||
|
pp desired.select { _1 =~ available }.size
|
||
|
|
||
|
__END__
|
||
|
r, wr, b, g, bwu, rb, gb, br
|
||
|
|
||
|
brwrr
|
||
|
bggr
|
||
|
gbbr
|
||
|
rrbgbr
|
||
|
ubwu
|
||
|
bwurrg
|
||
|
brgr
|
||
|
bbrgwb
|