# The general idea is to scan the given sequence $A$ looking for # subsequences of identical consecutive elements. If the subsequence # consists of one or two elements, then we simply print those element # one by one, otherwise we print the element followed by the count. We # can do this with a linear scan of $A$. # Tactically, we can proceed in a number of ways. One simple and quite # elegant way of doing that is to use two position indexes, $i$ and $j$, # with $i