questions_list
questions_list
Replace every element with the greatest element on the right side
**Problem:**
Given an array of integers, replace every element with the greatest element to its
right. Replace the last element with -1.
**Example:**
Input: `{16, 17, 4, 3, 5, 2}`
Output: `{17, 5, 5, 5, 2, -1}`
---
---
---
---
---
---
---