Hi Roelof You may have a look at my StringExtensions package at https://github.com/hernanmd/StringExtensions I wrote several algorithms for working with substrings like: https://github.com/hernanmd/StringExtensions/blob/master/repository/StringEx... https://github.com/hernanmd/StringExtensions/blob/master/repository/StringEx... Some of them used in https://github.com/hernanmd/BioSmalltalk where you can find also algorithms for k-mer counting and clump finding: https://github.com/hernanmd/BioSmalltalk/blob/master/repository/BioTools.pac... https://github.com/hernanmd/BioSmalltalk/blob/master/repository/BioTools.pac... for the Bio repo just consider a Sequence like a more advanced String. Cheers, Hernán El sáb., 29 dic. 2018 a las 13:29, Roelof Wobben (<r.wobben@home.nl>) escribió:
Hello,
Still working on AdventOfCode
Im struggeling to see how this can be solved.
Now, a nice string is one with all of the following properties:
It contains a pair of any two letters that appears at least twice in the string without overlapping, like xyxy (xy) or aabcdefgaa (aa), but not like aaa (aa, but it overlaps). It contains at least one letter which repeats with exactly one letter between them, like xyx, abcdefeghi (efe), or even aaa.
my game plan was this
1) group the characters and filter everything out which has a count not equal to two
2) find the indexes of the characters and with the indexes use a copy method so I have a substring out of it
3) do the same with the substring so again 1 and 2
but how can I make 2 work.
Roelof