Question: I got an input array = [ 6 , 5 , 4 , 1 , 3 , 2 ] and I want the output to
I got an input array and I want the output to be
Following the condition:
From each value in the array, one by one, if the left value is bigger than the right value, replace it with right value.
In case that the value is smaller than both left value and right value, replace the middle value with the minimum of left value and right value.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
