On Sun, 30 Dec 2018 at 17:53, Roelof Wobben via Pharo-users < pharo-users@lists.pharo.org> wrote:
> Op 30-12-2018 om 02:14 schreef Ben Coman: > > 'abcdefg' asArray overlappingPairsRemainderCollect: [ :a :b :rem | { > a.b.rem } ] > > This was deliberately only half a solution. The block above "[ :a :b :rem | { a.b.rem } ]" is a placeholder only - to show you what data you would have to work with. You need to adapt it. > Sorry, I do not see how this can work so I can find the answer > > qjhvhtzxzqqjkmpb is nice because is has a pair that appears twice (qj) > > so if I try it on the code for overlappingPairsRemainderCollect I see > this as answer : > > "#($q $j #($h $v $h $t $z $x $z $q $q $j $k $m $p $b))" > The line above looks pertinent!! Inside the block you will have... a ==> $q b ==> $j rem ==> #($h $v $h $t $z $x $z $q $q $j $k $m $p $b) <snip> > "#($p $b #())" > > How does help me the output in telling me that there are two pairs that > are there two times > You might start with the following block... [ :a :b :rem | self halt. rem overlappingPairsCollect: [ :a2 :b2 | ...something... ] ] and from in the debugger experiment by inspecting the second half of it. cheers -ben