Initialize left and right frequency arrays
let left = [ ] ; let right = [ ] ; let X = [ ] ; let Y = [ ] ; for ( let i = 0 ; i < N ; i ++ ) { X [ i ] = 0 ; left [ i ] = 0 ; right [ i ] = 0 ; Y [ i ] = 0 ; }