I am trying to solve this problem: Impressing the Boss. I am simply checking if the next element is smaller than the current element and this approach seems to pass half of the test cases but it is failing some. Please help in understanding the error in my approach. Here is my implementation:
asked 07 Apr '18, 15:35

check out this test case: 1 6 1 66 77 44 55 999. For this test case try all possible locations for which we will modify 1 to n, and try all possible values we want to use(min(a[i]) to max(a[i])) and finally we need to check the array is sorted or not.Time complexity will be O(pow(n,2)*max(a[i]). answered 07 Apr '18, 18:13

1
4
13 15 12 14