Java Solution using Monotonic decreasing stack
\nclass Solution {\n    public int[] nextGreaterElements(int[] nums) {\n        int len = 2 * nums.length - 1;\n        int[] result = new int[nums.length];\n  
```\nclass Solution {\n    public int[] nextGreaterElements(int[] nums) {\n        int len = 2 * nums.length - 1;\n        int[] result = new int[nums.length];\n        Arrays.fill(result, -1);\n        Stack<Integer> stack = new Stack<>();\n        for (int i = 0; i < len; i++) {\n            int index = i % nums.length;\n            while(!stack.isEmpty() && nums[stack.peek()] < nums[index]) {\n                int pop = stack.pop();\n                result[pop] = nums[index];\n            }\n            stack.push(index);\n        }\n        return result;\n    }\n}\n```
['Array', 'Monotonic Stack', 'Java']