Medium Accuracy: 25.34% Submissions: 676 Points: 4
Akku have solved many problems, she is genius. One day her friend gave her an Array and asked her to perform
some queries of following type:
Each query consists of three integers
1 A B : Update the Array at index A by value B
2 A B : if the subarray from index A to B (both inclusive) is
1. Both increasing(Non-decreasing) and decreasing(Non-increasing) print -1
2. Only increasing(Non-decreasing) print 0
3. Only decreasing(Non-increasing) print 1
4. Neither increasing nor decreasing print -1
Akku needs your help, can you help her.
The first line of input constists of the integer T, indicating the number of test cases.The first line of each
test case constists of the number N, indicating the number of elements in the array,A. Next line consists of N space
seperated integers indicating the array. Next line consists of an integer Q , denoting the
number of queries. Next Q lines consists of three integers X,A,B
For each test case query of type 2, the output is an integer indicating the required Answer in newline.