We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Monotonic stack.
Two loops, 2 * length - 1.
2 * length - 1
单调栈。
两次循环, 2 * length - 1。