111.二叉树的最小深度 【LetMeFly】111.二叉树的最小深度:DFS + 遇到叶节点更新最小深度力扣题目链接:https://leetcode.cn/problems/minimum-depth-of-binary-tree/ 给定一个二叉树,找出其最小深度。 最小深度是从根节点到最近叶子节点的最短路径上的节点数量。 说明:叶子节点是指没有子节点的节点。 示例 1: 输入:root = [3,9, 2022-07-11 #题解 #简单 #树 #LeetCode #深度优先搜索 #DFS #二叉树 #广度优先搜索 #树的深度
676.实现一个魔法字典 【LetMeFly】676.实现一个魔法字典:易实现但效率不是那么高的方法力扣题目链接:https://leetcode.cn/problems/implement-magic-dictionary/ 设计一个使用单词列表进行初始化的数据结构,单词列表中的单词 互不相同 。 如果给出一个单词,请判定能否只将这个单词中一个字母换成另一个字母,使得所形成的新单词存在于你构建的字典中。 实现 Magi 2022-07-11 #题解 #中等 #字符串 #LeetCode #哈希表 #set #字典树 #设计
AtCoder Beginner Contest 259 - D - Circumferences Time Limit: 2 sec / Memory Limit: 1024 MB Score : 400400400 points Problem StatementYou are given NNN circles on the xyxyxy-coordinate plane. For each i=1,2,…,Ni = 1, 2, \ldots, Ni=1,2,…,N, t 2022-07-09 #题解 #AtCoder #中等 #数学 #坐标 #连通图 #图 #思维
AtCoder Beginner Contest 259 - C - XX to XXX Time Limit: 2 sec / Memory Limit: 1024 MB Score : 300300300 points Problem StatementYou are given two strings SSS and TTT. Determine whether it is possible to make SSS equal TTT by performing 2022-07-09 #题解 #AtCoder #中等 #字符串 #字符串变换 #双指针
AtCoder Beginner Contest 259 - B - Counterclockwise Rotation Time Limit: 2 sec / Memory Limit: 1024 MB Score : 200200200 points Problem StatementIn an xyxyxy-coordinate plane whose xxx-axis is oriented to the right and whose yyy-axis is oriented upward 2022-07-09 #题解 #AtCoder #中等 #数学 #坐标 #旋转 #直角坐标与极坐标的转换
AtCoder Beginner Contest 259 - A - Growth Record Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100100 points Problem StatementTakahashi had his NNN-th birthday, when he was TTT centimeters tall. Additionally, we know the following fa 2022-07-09 #题解 #AtCoder #简单 #模拟 #数列
110.平衡二叉树 【LetMeFly】110.平衡二叉树 - 自底向上力扣题目链接:https://leetcode.cn/problems/balanced-binary-tree/ 给定一个二叉树,判断它是否是高度平衡的二叉树。 本题中,一棵高度平衡二叉树定义为: 一个二叉树每个节点 的左右两个子树的高度差的绝对值不超过 1 。 示例 1: 输入:root = [3,9,20,null,n 2022-07-09 #题解 #简单 #树 #LeetCode #深度优先搜索 #二叉树
109.有序链表转换二叉搜索树 【LetMeFly】109.有序链表转换二叉搜索树 - 链表中值为根,中值左右分别为左右子树力扣题目链接:https://leetcode.cn/problems/convert-sorted-list-to-binary-search-tree/ 给定一个单链表的头节点 head ,其中的元素 按升序排序 ,将其转换为高度平衡的二叉搜索树。 本题中,一个高度平衡二叉树是指 2022-07-09 #题解 #中等 #树 #LeetCode #链表 #分治 #哈希 #二叉树 #二叉搜索树 #BST
873.最长的斐波那契子序列的长度 【LetMeFly】873.最长的斐波那契子序列的长度力扣题目链接:https://leetcode.cn/problems/length-of-longest-fibonacci-subsequence/ 如果序列 X_1, X_2, ..., X_n 满足下列条件,就说它是 斐波那契式 的: n >= 3 对于所有 i + 2 2022-07-09 #题解 #中等 #数组 #动态规划 #LeetCode #DP #哈希表 #子问题 #最x子xx #斐波那契
108.将有序数组转换为二叉搜索树 【LetMeFly】108.将有序数组转换为二叉搜索树 - 数组中值为根,中值左右分别为左右子树力扣题目链接:https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/ 给你一个整数数组 nums ,其中元素已经按 升序 排列,请你将其转换为一棵 高度平衡 二叉搜索树。 高度平衡 二叉树是一棵满足「每个节点的左 2022-07-04 #题解 #简单 #数组 #树 #LeetCode #分治 #二叉树 #二叉搜索树 #BST