| 1 | Initialize pointers and counts | 0 | 0 | "A" | {"A":1} | No | None |
| 2 | Expand right to include 'D' | 0 | 1 | "AD" | {"A":1,"D":1} | No | None |
| 3 | Expand right to include 'O' | 0 | 2 | "ADO" | {"A":1,"D":1,"O":1} | No | None |
| 4 | Expand right to include 'B' | 0 | 3 | "ADOB" | {"A":1,"D":1,"O":1,"B":1} | No | None |
| 5 | Expand right to include 'E' | 0 | 4 | "ADOBE" | {"A":1,"D":1,"O":1,"B":1,"E":1} | No | None |
| 6 | Expand right to include 'C' | 0 | 5 | "ADOBEC" | {"A":1,"D":1,"O":1,"B":1,"E":1,"C":1} | Yes | "ADOBEC" |
| 7 | Shrink left to remove 'A' | 1 | 5 | "DOBEC" | {"D":1,"O":1,"B":1,"E":1,"C":1} | No | "ADOBEC" |
| 8 | Expand right to include 'O' | 1 | 6 | "DOBECO" | {"D":1,"O":2,"B":1,"E":1,"C":1} | No | "ADOBEC" |
| 9 | Expand right to include 'D' | 1 | 7 | "DOBECOD" | {"D":2,"O":2,"B":1,"E":1,"C":1} | No | "ADOBEC" |
| 10 | Expand right to include 'E' | 1 | 8 | "DOBECODE" | {"D":2,"O":2,"B":1,"E":2,"C":1} | No | "ADOBEC" |
| 11 | Expand right to include 'B' | 1 | 9 | "DOBECODEB" | {"D":2,"O":2,"B":2,"E":2,"C":1} | Yes | "ADOBEC" |
| 12 | Shrink left to remove 'D' | 2 | 9 | "OBECODEB" | {"O":2,"B":2,"E":2,"C":1,"D":1} | Yes | "ADOBEC" |
| 13 | Shrink left to remove 'O' | 3 | 9 | "BECODEB" | {"B":2,"E":2,"C":1,"D":1,"O":1} | Yes | "ADOBEC" |
| 14 | Shrink left to remove 'B' | 4 | 9 | "ECODEB" | {"E":2,"C":1,"D":1,"O":1,"B":1} | Yes | "ADOBEC" |
| 15 | Shrink left to remove 'E' | 5 | 9 | "CODEB" | {"C":1,"D":1,"O":1,"B":1,"E":1} | Yes | "ADOBEC" |
| 16 | Shrink left to remove 'C' | 6 | 9 | "ODEB" | {"O":1,"D":1,"E":1,"B":1} | No | "ADOBEC" |
| 17 | Expand right to include 'A' | 6 | 10 | "ODEBA" | {"O":1,"D":1,"E":1,"B":1,"A":1} | No | "ADOBEC" |
| 18 | Expand right to include 'N' | 6 | 11 | "ODEBAN" | {"O":1,"D":1,"E":1,"B":1,"A":1,"N":1} | No | "ADOBEC" |
| 19 | Expand right to include 'C' | 6 | 12 | "ODEBANC" | {"O":1,"D":1,"E":1,"B":1,"A":1,"N":1,"C":1} | Yes | "ADOBEC" |
| 20 | Shrink left to remove 'O' | 7 | 12 | "DEBANC" | {"D":1,"E":1,"B":1,"A":1,"N":1,"C":1} | Yes | "ADOBEC" |
| 21 | Shrink left to remove 'D' | 8 | 12 | "EBANC" | {"E":1,"B":1,"A":1,"N":1,"C":1} | Yes | "ADOBEC" |
| 22 | Shrink left to remove 'E' | 9 | 12 | "BANC" | {"B":1,"A":1,"N":1,"C":1} | Yes | "ADOBEC" |
| 23 | Shrink left to remove 'B' | 10 | 12 | "ANC" | {"A":1,"N":1,"C":1} | No | "ADOBEC" |
| 24 | End: right pointer reached end | 10 | 12 | "ANC" | {"A":1,"N":1,"C":1} | No | "BANC" |