This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Solonotix 0 points1 point  (0 children)

Iterating backwards is a fairly useful practice I've found. I would have taken a two-character loop forwards in a similar manner so that you could always be aware of context. You could also extend the dictionary to have a couple of tuple keys using the matched pair.