Driver Code
let arr = [ 2 , 6 , 1 , 8 , 3 , 4 ] ; let N = arr . length ; let Q = [ new Query ( 0 , 3 ) , new Query ( 1 , 5 ) , new Query ( 4 , 5 ) ] ; let M = Q . length ; minimumDifference ( arr , Q , N , M ) ;