摘要:
二叉树的中序遍历 题目链接:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ 面试的时候问这道题基本都是考察非递归的写法,但还是贴一下递归写法: 方法1:递归 var result []int func f(root *T 阅读全文
摘要:
最长有效括号 题目链接:https://leetcode-cn.com/problems/longest-valid-parentheses/ 给你一个只包含 '(' 和 ')' 的字符串,找出最长有效(格式正确且连续)括号子串的长度。 示例 1: 输入:s = "(()" 输出:2 解释:最长有效 阅读全文