Given an integer array arr, replace every element in the array with the greatest element among all elements to its right, and replace the final element with
Return the modified array.
Constraints:
arr.length
arr[i]
Given an integer array arr, replace every element in the array with the greatest element among all elements to its right, and replace the final element with
Return the modified array.
Constraints:
arr.length
arr[i]