--- Begin Message ---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/StringExtensions.package/String.extension/instance/indexesOfMotif..st https://github.com/hernanmd/StringExtensions/blob/master/repository/StringExtensions.package/String.extension/instance/indicesOfSubstringOverlaps..st 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.package/BioSequence.class/instance/clumpFindK.length.times..st https://github.com/hernanmd/BioSmalltalk/blob/master/repository/BioTools.package/BioSequence.class/instance/kmersCount.mismatches..st 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 (<[email protected]>) 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 > >
--- End Message ---
Re: [Pharo-users] how to use indexes to copy a substring out of a string
Hernán Morales Durand via Pharo-users Sat, 29 Dec 2018 12:15:26 -0800
- [Pharo-users] how to use indexes to... Roelof Wobben
- Re: [Pharo-users] how to use i... Hernán Morales Durand via Pharo-users
- Re: [Pharo-users] how to u... Roelof Wobben
- Re: [Pharo-users] how to use i... Ben Coman
- Re: [Pharo-users] how to u... Roelof Wobben via Pharo-users
- Re: [Pharo-users] how to u... Roelof Wobben via Pharo-users
- Re: [Pharo-users] how ... Ben Coman
- Re: [Pharo-users] how to use i... Richard O'Keefe via Pharo-users
