Driver code
if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N , queries = 8 , 6 NEW_LINE Q = [ [ 1 , 4 ] , [ 3 , 4 ] , [ 4 , 5 ] , [ 5 , 5 ] , [ 7 , 8 ] , [ 8 , 8 ] ] NEW_LINE A = [ 0 ] * N NEW_LINE print ( subarrayLength ( A , Q , N , queries ) ) NEW_LINE DEDENT