public static int[] method(int[] arr) {         int[] res = new int[arr.length];         Arrays.fill(res, -1);         Stack<Integer> stack = new Stack<>();         for (int i = 0; i < res.length; i++) {             //递减栈             while (!stack.isEmpty() && arr[stack.peek()] < arr[i]) {;                 res[stack.pop()]=arr[i];             }             stack.push(i);         }         return res;     }