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 [ st . length - 1 ] . c == s [ i ] ) { let p = st [ st . length - 1 ] ; st . pop ( ) ; p . ctr += 1 ; if ( p . ctr == k ) { continue ; } else { st . push ( p ) ; } } else {