Loop to store the count of continuous characters in the given string
for i in range ( 1 , n ) : NEW_LINE INDENT if ( s [ i ] == s [ i - 1 ] ) : NEW_LINE INDENT cnt += 1 NEW_LINE DEDENT else : NEW_LINE INDENT v . append ( cnt ) NEW_LINE cnt = 1 NEW_LINE DEDENT DEDENT if ( cnt > 0 ) : NEW_LINE INDENT v . append ( cnt ) NEW_LINE DEDENT