Given an array consisting of N non-negative integers. You may perform the given operation on an array element but the operation can be performed on each element no more than once.
For an element A[i] of the array , 1<=i<=N :
Check if the entire sequence can be converted into a strictly increasing sequence. Print Yes if the sequence can be converted into a strictly increasing sequence, else print No.
Example
Consider N = 4, and A[] = [1, 15, 10, 15].
Initially, the array is not in Strictly Increasing Order.
Let's select the array element, A[1] (=15) and X = 10. If we perform A[1] = A[1] - X, the new array is A[] = [1, 5, 10, 15].
Now the array A is in strictly increasing order.
Therefore the answer is "Yes".
Function description
Complete the solve function provided in the editor. This function takes the following 2 parameters and returns the answer:
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
Output Format:
For each test case, print 'Yes' if after all the performed operations the sequence becomes STRICTLY INCREASING else print 'No' on a new line.
Constraints:
1<=T<=10
1<=N<=100000
0<=A[i]<=100000
Code snippets (also called starter code/boilerplate code)
This question has code snippets for C, CPP, Java, and Python.
The first line represents the number of test cases, t = 1.
The first test case
Given array of five elements as : 2 6 4 5 7
If we take X=3 for array element 6 then the sequence turns to be 2 (6-3) 4 5 7 , or
2 3 4 5 7, which is strictly increasing.