the minimum absolute difference array define minimum value ai aj 0 j alength ai aj if element minimum absolute difference 1for example minimum absolute difference array 52372 2 3 1 note 0 ai aj differentyou give integer array nums array query queriesi li ri for query compute minimum absolute difference subarray numsliri contain element num 0based index li ri inclusiveReturn array ans ansi answer ith queryA subarray contiguous sequence element arraythe value x define asx x 0x x 0 example 1input num 1348 query 01122303output 2141explanation the query process follow queries0 01 the subarray 13 minimum absolute difference 13 2 queries1 12 the subarray 34 minimum absolute difference 34 1 queries2 23 the subarray 48 minimum absolute difference 48 4 queries3 03 the subarray 1348 minimum absolute difference 34 1example 2input num 4522710 query 23020535output 1113explanation the query process follow queries0 23 the subarray 22 minimum absolute difference 1 element queries1 02 the subarray 452 minimum absolute difference 45 1 queries2 05 the subarray 4522710 minimum absolute difference 45 1 queries3 35 the subarray 2710 minimum absolute difference 710 3 constraints2 numslength 1051 numsi 1001 querieslength 2 1040 li ri numslength