How would you solve the following problem?
Given the following array of strings we want to find all groups whose group leader starts with “AT”.
All the elements that are found before the first one starting with “AT” form a group by themselves.
julia> itr=[randstring("ACTG") for _ in 1:20]
20-element Vector{String}:
"CTTCCGAG"
"CCCGTGGT"
"TCAAGGGT"
"ATTAGATC"
"TCTTACAC"
"TTTCCGCC"
"TCCGACCG"
"GTCAGCTA"
"CATGTTGC"
"GAGGAACG"
"GTCAATGC"
"TACTCATT"
"ATACTCTA"
"AATTCACA"
"AATCATAT"
"GTATACCT"
"ATTTTACT"
"TTCAGAAG"
"GTTGATGA"
"GACGGCGG"
julia> mygroupby(itr, criteria)
4-element Vector{Tuple{Vararg{String}}}:
("CTTCCGAG", "CCCGTGGT", "TCAAGGGT")
("ATTAGATC", "TCTTACAC", "TTTCCGCC", "TCCGACCG", "GTCAGCTA", "CATGTTGC", "GAGGAACG", "GTCAATGC", "TACTCATT")
("ATACTCTA", "AATTCACA", "AATCATAT", "GTATACCT")
("ATTTTACT", "TTCAGAAG", "GTTGATGA")