Given a linked list, for each node return the value of the first node to its right that has a strictly greater value, or 0 if there is no such node. Return the answers as an array in node order.
Input: An array of node values.
Output: Array — next greater value per node (0 if none).
Input: [2,1,5]
Output: [5,5,0]
Explanation: Next greater of 2 and 1 is 5; 5 has none.Input: [2,7,4,3,5]
Output: [7,0,5,5,0]
Explanation: Per-node next greater.Input: [1]
Output: [0]
Explanation: No greater node.0<=n<=10^40<=value<=10^9