Enter array of nums:


Find the larger value between the first or last and set all the other elements with that value.