LeetCode Solution, Easy, 1299. Replace Elements with Greatest Element