Problem: Given an array arr[]. Need to make the array strictly increasing and if we can do so print "Yes" else "No".
Criteria: We can mke it strictly increasing by subtracting a value, say X, from arr[i] such that 0<=X<=arr[i].
Eg:
Input: arr[] = {2,15,10,15}
output: Yes
Expalanation: take X = 10 and subtract it from arr[1]. So the sequence becomes {2,5,10,15}, which is strictly increasing.
I tried the below brute force approach and 9/10 test cases passed. 10th TC was locked.
Approach:
Any better approach for this?