Leader array questions.
[Question 1] .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 Example 1:: Input: arr = [17,18,5,4,6,1] Output: [18,6,6,6,1,-1] Explanation: – index 0 –> the greatest element to the right of index 0 is index 1 (18). – index 1 –> […]
Leader array questions. Read More »