Solve a variant of the Next Greater element to the Right (NGR) problem using a stack.
Asked in the HLD/LLD round stage. DSA problem after the concurrency question.
Given an array of integers nums, return an array result where result[i] is the first element to the right of nums[i] that is strictly greater than nums[i]. If no such element exists, set result[i] = -1.
nums is a list of integers. Return a list of integers of the same length.
def next_greater_right(nums):