What value is assigned when no greater value exists?
Practice this question from Next Greater Element I - Monotonic stack Pattern Practice Quiz, with options and an explanation.
Question
What value is assigned when no greater value exists?
Option A — Correct answer
-1
Option B
0
Option C
The same value
Option D
The array length
Explanation
Use -1 for unresolved values.