Function that prlets the number of times X gets a value between L and R
function goodLeteger ( arr , n , h , l , r ) { let dp = new Array ( n + 1 ) ; for ( var i = 0 ; i < dp . length ; i ++ ) { dp [ i ] = new Array ( 2 ) ; } for ( let i = 0 ; i < n + 1 ; i ++ ) for ( let j = 0 ; j < h ; j ++ ) dp [ i ] [ j ] = - 1 ;