if character at top of stack is same as current character increase the number of repetitions in the top of stack by 1
if ( st . peek ( ) . c == s . charAt ( i ) ) { Pair p = st . peek ( ) ; st . pop ( ) ; p . ctr += 1 ; if ( p . ctr == k ) { continue ; } else { st . push ( p ) ; } } else {