NEXT GREATEST ELEMENT USING RECURSION

Given an array, print the Next Greater Element (NGE) for every element using RECURSION ONLY. The Next greater Element for an element x is the first greater element on the right side of x in array. Elements for which no greater element exist, consider next greater element as -1.
input array [4, 5, 2, 25}
output array {5,25,25,-1}
How to solve this USING RECURSION ONLY.

@vatsal38 can you help me

@pratyush63 can you look into this problem without using stack only recursion