← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given a linked list of integers, return a linked list (or array) of integers such that each output element is the next greater node for the corresponding node in the original list. The next greater node is the first node that appears later in the list and has a value strictly larger than the current node. If no such node exists, use 0 for that position.