Whenever a sequence of same value is encountered
while ( i + 1 < N and arr [ i ] == arr [ i + 1 ] ) : NEW_LINE INDENT flag = 1 NEW_LINE i += 1 NEW_LINE DEDENT if ( flag ) : NEW_LINE INDENT clumps += 1 NEW_LINE DEDENT i += 1 NEW_LINE