https://leetcode.com/problems/replace-elements-with-greatest-element-on-right-side/ 1. 2022/04/25 시도 소요시간: 9분(시간복잡도 O(n^2)), 4분(시간복잡도 O(n)) // O(n) class Solution { public int[] replaceElements(int[] arr) { int post = arr[arr.length-1]; arr[arr.length-1] = -1; for (int i=arr.length-2; i>=0; i--) { int temp = post; if (arr[i] > post) { post = arr[i]; } arr[i]=temp; } return arr; } } // O(n^2) cla..