leetcode.com 2025-12-29
🟡756.pyramid-transition-matrix
🏷️ Tags
#bit_manipulation #hash_table #string #backtracking
🟡756.pyramid-transition-matrix
🏷️ Tags
#bit_manipulation #hash_table #string #backtracking
Telegraph
pyramid-transition-matrix
You are stacking blocks to form a pyramid. Each block has a color, which is represented by a single letter. Each row of blocks contains one less block than the row beneath it and is centered on top. To make the pyramid aesthetically pleasing, there are only…
leetcode.cn 2025-12-31
🔴1970.last-day-where-you-can-still-cross
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #binary_search #matrix
🔴1970.last-day-where-you-can-still-cross
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #binary_search #matrix
Telegraph
last-day-where-you-can-still-cross
给你一个下标从 1 开始的二进制矩阵,其中 0 表示陆地,1 表示水域。同时给你 row 和 col 分别表示矩阵中行和列的数目。 一开始在第 0 天,整个 矩阵都是 陆地 。但每一天都会有一块新陆地被 水 淹没变成水域。给你一个下标从 1 开始的二维数组 cells ,其中 cells[i] = [ri, ci] 表示在第 i 天,第 ri 行 ci 列(下标都是从 1 开始)的陆地会变成 水域 (也就是 0 变成 1 )。 你想知道从矩阵最 上面 一行走到最 下面 一行,且只经过陆地格子的 最后一天…
leetcode.com 2025-12-31
🔴1970.last-day-where-you-can-still-cross
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #binary_search #matrix
🔴1970.last-day-where-you-can-still-cross
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #binary_search #matrix
Telegraph
last-day-where-you-can-still-cross
There is a 1-based binary matrix where 0 represents land and 1 represents water. You are given integers row and col representing the number of rows and columns in the matrix, respectively. Initially on day 0, the entire matrix is land. However, each day a…
leetcode.cn 2026-01-06
🟡1161.maximum-level-sum-of-a-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
🟡1161.maximum-level-sum-of-a-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
Telegraph
maximum-level-sum-of-a-binary-tree
给你一个二叉树的根节点 root。设根节点位于二叉树的第 1 层,而根节点的子节点位于第 2 层,依此类推。 返回总和 最大 的那一层的层号 x。如果有多层的总和一样大,返回其中 最小 的层号 x。 示例 1: 输入:root = [1,7,0,7,-8,null,null] 输出:2 解释: 第 1 层各元素之和为 1, 第 2 层各元素之和为 7 + 0 = 7, 第 3 层各元素之和为 7 + -8 = -1, 所以我们返回第 2 层的层号,它的层内元素之和最大。 示例 2: 输入:root =…
leetcode.com 2026-01-06
🟡1161.maximum-level-sum-of-a-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
🟡1161.maximum-level-sum-of-a-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
Telegraph
maximum-level-sum-of-a-binary-tree
Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level x such that the sum of all the values of nodes at level x is maximal. Example 1: Input: root = [1,7,0,7,-8,null,null] Output:…
leetcode.cn 2026-01-07
🟡1339.maximum-product-of-splitted-binary-tree
🏷️ Tags
#tree #depth_first_search #binary_tree
🟡1339.maximum-product-of-splitted-binary-tree
🏷️ Tags
#tree #depth_first_search #binary_tree
Telegraph
maximum-product-of-splitted-binary-tree
给你一棵二叉树,它的根为 root 。请你删除 1 条边,使二叉树分裂成两棵子树,且它们子树和的乘积尽可能大。 由于答案可能会很大,请你将结果对 10^9 + 7 取模后再返回。 示例 1: 输入:root = [1,2,3,4,5,6] 输出:110 解释:删除红色的边,得到 2 棵子树,和分别为 11 和 10 。它们的乘积是 110 (11*10) 示例 2: 输入:root = [1,null,2,3,4,null,null,5,6] 输出:90 解释:移除红色的边,得到 2 棵子树,和分别是…
leetcode.com 2026-01-07
🟡1339.maximum-product-of-splitted-binary-tree
🏷️ Tags
#tree #depth_first_search #binary_tree
🟡1339.maximum-product-of-splitted-binary-tree
🏷️ Tags
#tree #depth_first_search #binary_tree
Telegraph
maximum-product-of-splitted-binary-tree
Given the root of a binary tree, split the binary tree into two subtrees by removing one edge such that the product of the sums of the subtrees is maximized. Return the maximum product of the sums of the two subtrees. Since the answer may be too large, return…