https://feedx.net
思路:倒序单调栈。弹出所有 ≤ 当前身高的元素(这些人都能被看到),count 为弹出数量;若栈非空,还能看到栈顶(第一个更高的人),故 +1。能看到的人数 = count + (栈非空 ? 1 : 0)。
,详情可参考快连下载安装
but it's used for deciding which keywords you plan on using for future content
AFP via Getty Images
专注于提供最新行业资讯与深度分析报道
· 王芳 · 来源:dev资讯
https://feedx.net
思路:倒序单调栈。弹出所有 ≤ 当前身高的元素(这些人都能被看到),count 为弹出数量;若栈非空,还能看到栈顶(第一个更高的人),故 +1。能看到的人数 = count + (栈非空 ? 1 : 0)。
,详情可参考快连下载安装
but it's used for deciding which keywords you plan on using for future content
AFP via Getty Images