Next Greater Element II
Asked in the DSA stage.
Given an array of integers nums, return an array result where result[i] is the first element greater than nums[i] encountered while moving forward circularly. The element after the last position is the first element.
Implement next_greater_elements(nums). Return -1 when no greater element exists.
def next_greater_elements(nums):