Replace Elements with Greatest Element on Right Side
Problem Statement:
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.
So, how can we solve this problem?
Appro...
nileshsaini.hashnode.dev3 min read