1944. Number of Visible People in a Queue
1944. Number of Visible People in a Queue
Description
Solution
Using monotone stack, look into preceding first number larger than current one.
Code
1 | class Solution { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.