Loop to store the count of continious characters in the given string
for ( int i = 1 ; i < n ; i ++ ) { if ( s [ i ] == s [ i - 1 ] ) cnt ++ ; else { v . push_back ( cnt ) ; cnt = 1 ; } } if ( cnt > 0 ) v . push_back ( cnt ) ;