A run of
a word over an alphabet is
a maximal consecutive block of one repeated letter. For
a nonempty
word w of
length N, its
number of runs is
R(w)=1+∑j=1N−11{wj=wj+1}.
Replacing
a consecutive constant block changes this count only through its boundaries with the neighboring letters.
New to topics? Read the docs here!