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 [ i ] ) { Pair p = st . Peek ( ) ; st . Pop ( ) ; p . ctr += 1 ; if ( p . ctr == k ) { continue ; } else { st . Push ( p ) ; } } else {