Hold on!

Warning: this link might be unsafe, please double check the link before you proceed.

https://helloacm.com/replace-elements-with-greatest-element-on-right-side-using-c-stdexchange-method/