GoLang Solution For LeetCode Problem: Replace Elements with Greatest Element on Right Side
Solving Replace Elements with Greatest Element on Right Side in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.
Problem Description
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
1 <= arr.length <= 10^4
1 <= arr[i] <= 10^5
See the full details of the problem Replace Elements with Greatest Element on Right Side at LeetCode
Originally posted at: @github.com/halfrost/LeetCode-Go
Comments
Leave a comment
You are not LoggedIn but you can comment as an anonymous user which requires manual approval. For better experience please Login.