Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Move forward in nums and store the value in a non-increasing stack for the first greater value.
Move the value in the stack to an ordered data structure for the second greater value.
Move value from the ordered data structure for the answer.