# ---
# title: 1299. Replace Elements with Greatest Element on Right Side
# id: problem1299
# author: Tian Jun
# date: 2020-10-31
# difficulty: Easy
# categories: Array
# link: <https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side/description/>
# hidden: true
# ---
# 
# Given an array `arr`, replace every element in that array with the greatest
# element among the elements to its right, and replace the last element with
# `-1`.
# 
# After doing so, return the array.
# 
# 
# 
# **Example 1:**
# 
#     
#     
#     Input: arr = [17,18,5,4,6,1]
#     Output: [18,6,6,6,1,-1]
#     
# 
# 
# 
# **Constraints:**
# 
#   * `1 <= arr.length <= 10^4`
#   * `1 <= arr[i] <= 10^5`
# 
# 
## @lc code=start
using LeetCode

## add your code here:
## @lc code=end
