摘要: 给定两个整数数组 preorder 和 inorder ,其中 preorder 是二叉树的先序遍历, inorder 是同一棵树的中序遍历,请构造二叉树并返回其根节点。 示例 1: 输入: preorder = [3,9,20,15,7], inorder = [9,3,15,20,7]输出: [ 阅读全文
posted @ 2022-11-17 17:42 slowlydance2me 阅读(19) 评论(0) 推荐(0) 编辑
摘要: 给你一个整数 n ,求恰由 n 个节点组成且节点值从 1 到 n 互不相同的 二叉搜索树 有多少种?返回满足题意的二叉搜索树的种数。 示例 1: 输入:n = 3输出:5示例 2: 输入:n = 1输出:1 提示: 1 <= n <= 19 来源:力扣(LeetCode)链接:https://lee 阅读全文
posted @ 2022-11-17 16:43 slowlydance2me 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 1.What is the difference between set vs map in C++ ? 👉stl - C++中的设置与地图有什么区别?- 堆栈溢出 (stackoverflow.com) The're fullfilling different purposes, one is 阅读全文
posted @ 2022-11-17 15:23 slowlydance2me 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: s = "abcabcbb"输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。示例 2: 输入: s = "bbbbb"输出: 1解释: 因为无重复字符的最长子串是 "b",所以其 阅读全文
posted @ 2022-11-17 14:04 slowlydance2me 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 维基百科连接👇: nops substr() upper_bound() find() 阅读全文
posted @ 2022-11-17 11:57 slowlydance2me 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 给定字符串 s 和字符串数组 words, 返回 words[i] 中是s的子序列的单词个数 。 字符串的 子序列 是从原始字符串中生成的新字符串,可以从中删去一些字符(可以是none),而不改变其余字符的相对顺序。 例如, “ace” 是 “abcde” 的子序列。 示例 1: 输入: s = " 阅读全文
posted @ 2022-11-17 11:23 slowlydance2me 阅读(13) 评论(0) 推荐(0) 编辑