prefixCnt [ i ] : Stores number of times str [ i ] toggled by performing all the queries
let prefixCnt = new Array ( N + 1 ) ; for ( let i = 0 ; i < N + 1 ; i ++ ) { prefixCnt [ i ] = 0 ; } for ( let i = 0 ; i < M ; i ++ ) {