## 栈 | \# | 题名 | 题解 | 通过率 | 难度 | 出现频率 | |------|----------------------|-----|--------|----|--------| |42|[接雨水](https://leetcode-cn.com/problems/trapping-rain-water) |[175](https://leetcode-cn.com/problems/trapping-rain-water/solution)|47.6%|困难|58.78%| |85|[最大矩形](https://leetcode-cn.com/problems/maximal-rectangle) |[37](https://leetcode-cn.com/problems/maximal-rectangle/solution)|43.4%|困难|55.2%| |394|[字符串解码](https://leetcode-cn.com/problems/decode-string) |[70](https://leetcode-cn.com/problems/decode-string/solution)|47.4%|中等|47.9%| |726|[原子的数量](https://leetcode-cn.com/problems/number-of-atoms) |[12](https://leetcode-cn.com/problems/number-of-atoms/solution)|42.9%|困难|40.47%| |20|[有效的括号](https://leetcode-cn.com/problems/valid-parentheses) |[468](https://leetcode-cn.com/problems/valid-parentheses/solution)|40.3%|简单|40.32%| |224|[基本计算器](https://leetcode-cn.com/problems/basic-calculator) |[54](https://leetcode-cn.com/problems/basic-calculator/solution)|36.2%|困难|34.95%| |84|[柱状图中最大的矩形](https://leetcode-cn.com/problems/largest-rectangle-in-histogram) |[69](https://leetcode-cn.com/problems/largest-rectangle-in-histogram/solution)|37.8%|困难|32.53%| |94|[二叉树的中序遍历](https://leetcode-cn.com/problems/binary-tree-inorder-traversal) |[132](https://leetcode-cn.com/problems/binary-tree-inorder-traversal/solution)|69.3%|中等|32.1%| |907|[子数组的最小值之和](https://leetcode-cn.com/problems/sum-of-subarray-minimums) |[14](https://leetcode-cn.com/problems/sum-of-subarray-minimums/solution)|26.4%|中等|31.55%| |402|[移掉K位数字](https://leetcode-cn.com/problems/remove-k-digits) |[34](https://leetcode-cn.com/problems/remove-k-digits/solution)|27.1%|中等|30.44%| |456|[132模式](https://leetcode-cn.com/problems/132-pattern) |[21](https://leetcode-cn.com/problems/132-pattern/solution)|24.8%|中等|29.5%| |385|[迷你语法分析器](https://leetcode-cn.com/problems/mini-parser) |[14](https://leetcode-cn.com/problems/mini-parser/solution)|39.6%|中等|28.57%| |1124|[表现良好的最长时间段](https://leetcode-cn.com/problems/longest-well-performing-interval) |[25](https://leetcode-cn.com/problems/longest-well-performing-interval/solution)|21.8%|中等|27.93%| |1190|[反转每对括号间的子串](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses) |[36](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/solution)|49.5%|中等|26.8%| |103|[二叉树的锯齿形层次遍历](https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal) |[121](https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/solution)|52.8%|中等|26.76%| |975|[奇偶跳](https://leetcode-cn.com/problems/odd-even-jump) |[3](https://leetcode-cn.com/problems/odd-even-jump/solution)|41.4%|困难|26.75%| |739|[每日温度](https://leetcode-cn.com/problems/daily-temperatures) |[85](https://leetcode-cn.com/problems/daily-temperatures/solution)|56.5%|中等|26.58%| |232|[用栈实现队列](https://leetcode-cn.com/problems/implement-queue-using-stacks) |[101](https://leetcode-cn.com/problems/implement-queue-using-stacks/solution)|61.8%|简单|25.73%| |225|[用队列实现栈](https://leetcode-cn.com/problems/implement-stack-using-queues) |[74](https://leetcode-cn.com/problems/implement-stack-using-queues/solution)|61.5%|简单|25.16%| |155|[最小栈](https://leetcode-cn.com/problems/min-stack) |[129](https://leetcode-cn.com/problems/min-stack/solution)|50.7%|简单|24.73%| |1021|[删除最外层的括号](https://leetcode-cn.com/problems/remove-outermost-parentheses) |[121](https://leetcode-cn.com/problems/remove-outermost-parentheses/solution)|75.3%|简单|24.47%| |1130|[叶值的最小代价生成树](https://leetcode-cn.com/problems/minimum-cost-tree-from-leaf-values) |[15](https://leetcode-cn.com/problems/minimum-cost-tree-from-leaf-values/solution)|55.2%|中等|24.33%| |636|[函数的独占时间](https://leetcode-cn.com/problems/exclusive-time-of-functions) |[15](https://leetcode-cn.com/problems/exclusive-time-of-functions/solution)|48.3%|中等|22.8%| |144|[二叉树的前序遍历](https://leetcode-cn.com/problems/binary-tree-preorder-traversal) |[96](https://leetcode-cn.com/problems/binary-tree-preorder-traversal/solution)|63.0%|中等|21.69%| |880|[索引处的解码字符串](https://leetcode-cn.com/problems/decoded-string-at-index) |[13](https://leetcode-cn.com/problems/decoded-string-at-index/solution)|21.6%|中等|21.37%| |901|[股票价格跨度](https://leetcode-cn.com/problems/online-stock-span) |[21](https://leetcode-cn.com/problems/online-stock-span/solution)|35.8%|中等|20.42%| |946|[验证栈序列](https://leetcode-cn.com/problems/validate-stack-sequences) |[22](https://leetcode-cn.com/problems/validate-stack-sequences/solution)|52.6%|中等|20.2%| |316|[去除重复字母](https://leetcode-cn.com/problems/remove-duplicate-letters) |[36](https://leetcode-cn.com/problems/remove-duplicate-letters/solution)|35.9%|困难|20.14%| |145|[二叉树的后序遍历](https://leetcode-cn.com/problems/binary-tree-postorder-traversal) |[96](https://leetcode-cn.com/problems/binary-tree-postorder-traversal/solution)|69.2%|困难|20.06%| |439|[三元表达式解析器](https://leetcode-cn.com/problems/ternary-expression-parser) |[12](https://leetcode-cn.com/problems/ternary-expression-parser/solution)|55.6%|中等|17.74%| |255|[验证前序遍历序列二叉搜索树](https://leetcode-cn.com/problems/verify-preorder-sequence-in-binary-search-tree) |[11](https://leetcode-cn.com/problems/verify-preorder-sequence-in-binary-search-tree/solution)|44.9%|中等|17.3%| |71|[简化路径](https://leetcode-cn.com/problems/simplify-path) |[86](https://leetcode-cn.com/problems/simplify-path/solution)|38.0%|中等|16.92%| |735|[行星碰撞](https://leetcode-cn.com/problems/asteroid-collision) |[23](https://leetcode-cn.com/problems/asteroid-collision/solution)|36.8%|中等|16.85%| |150|[逆波兰表达式求值](https://leetcode-cn.com/problems/evaluate-reverse-polish-notation) |[66](https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/solution)|48.0%|中等|16.38%| |341|[扁平化嵌套列表迭代器](https://leetcode-cn.com/problems/flatten-nested-list-iterator) |[18](https://leetcode-cn.com/problems/flatten-nested-list-iterator/solution)|60.9%|中等|15.48%| |331|[验证二叉树的前序序列化](https://leetcode-cn.com/problems/verify-preorder-serialization-of-a-binary-tree) |[21](https://leetcode-cn.com/problems/verify-preorder-serialization-of-a-binary-tree/solution)|42.9%|中等|14.98%| |496|[下一个更大元素 I](https://leetcode-cn.com/problems/next-greater-element-i) |[68](https://leetcode-cn.com/problems/next-greater-element-i/solution)|62.3%|简单|14.86%| |503|[下一个更大元素 II](https://leetcode-cn.com/problems/next-greater-element-ii) |[32](https://leetcode-cn.com/problems/next-greater-element-ii/solution)|51.1%|中等|14.22%| |856|[括号的分数](https://leetcode-cn.com/problems/score-of-parentheses) |[27](https://leetcode-cn.com/problems/score-of-parentheses/solution)|56.3%|中等|14.08%| |682|[棒球比赛](https://leetcode-cn.com/problems/baseball-game) |[53](https://leetcode-cn.com/problems/baseball-game/solution)|64.9%|简单|10.78%| |844|[比较含退格的字符串](https://leetcode-cn.com/problems/backspace-string-compare) |[50](https://leetcode-cn.com/problems/backspace-string-compare/solution)|49.4%|简单|10.33%| |173|[二叉搜索树迭代器](https://leetcode-cn.com/problems/binary-search-tree-iterator) |[57](https://leetcode-cn.com/problems/binary-search-tree-iterator/solution)|69.6%|中等|9.35%| |1047|[删除字符串中的所有相邻重复项](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string) |[61](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/solution)|65.1%|简单|7.9%| |1019|[链表中的下一个更大节点](https://leetcode-cn.com/problems/next-greater-node-in-linked-list) |[23](https://leetcode-cn.com/problems/next-greater-node-in-linked-list/solution)|48.5%|中等|6.34%| |1249|[移除无效的括号](https://leetcode-cn.com/problems/minimum-remove-to-make-valid-parentheses) |[37](https://leetcode-cn.com/problems/minimum-remove-to-make-valid-parentheses/solution)|52.9%|中等|5.66%| |1209|[删除字符串中的所有相邻重复项 II](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string-ii) |[27](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string-ii/solution)|50.9%|中等| | |1063|[有效子数组的数目](https://leetcode-cn.com/problems/number-of-valid-subarrays) |[4](https://leetcode-cn.com/problems/number-of-valid-subarrays/solution)|61.0%|困难| | |1003|[检查替换后的词是否有效](https://leetcode-cn.com/problems/check-if-word-is-valid-after-substitutions) |[16](https://leetcode-cn.com/problems/check-if-word-is-valid-after-substitutions/solution)|55.0%|中等| | |921|[使括号有效的最少添加](https://leetcode-cn.com/problems/minimum-add-to-make-parentheses-valid) |[28](https://leetcode-cn.com/problems/minimum-add-to-make-parentheses-valid/solution)|69.0%|中等| | |895|[最大频率栈](https://leetcode-cn.com/problems/maximum-frequency-stack) |[2](https://leetcode-cn.com/problems/maximum-frequency-stack/solution)|45.2%|困难| | |772|[基本计算器 III](https://leetcode-cn.com/problems/basic-calculator-iii) |[10](https://leetcode-cn.com/problems/basic-calculator-iii/solution)|30.6%|困难| | |770|[基本计算器 IV](https://leetcode-cn.com/problems/basic-calculator-iv) |[4](https://leetcode-cn.com/problems/basic-calculator-iv/solution)|47.3%|困难| | |591|[标签验证器](https://leetcode-cn.com/problems/tag-validator) |[9](https://leetcode-cn.com/problems/tag-validator/solution)|28.5%|困难| | |272|[最接近的二叉搜索树值 II](https://leetcode-cn.com/problems/closest-binary-search-tree-value-ii) |[13](https://leetcode-cn.com/problems/closest-binary-search-tree-value-ii/solution)|56.9%|困难| |