leetcode.com 2026-07-05
🔴1301.number-of-paths-with-max-score
🏷️ Tags
#array #dynamic_programming #matrix
🔴1301.number-of-paths-with-max-score
🏷️ Tags
#array #dynamic_programming #matrix
Telegraph
number-of-paths-with-max-score
You are given a square board of characters. You can move on the board starting at the bottom right square marked with the character 'S'. You need to reach the top left square marked with the character 'E'. The rest of the squares are labeled either with a…
leetcode.cn 2026-07-08
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
Telegraph
concatenate-non-zero-digits-and-multiply-by-sum-ii
给你一个长度为 m 的字符串 s,其中仅包含数字。另给你一个二维整数数组 queries,其中 queries[i] = [li, ri]。
leetcode.com 2026-07-08
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
Telegraph
concatenate-non-zero-digits-and-multiply-by-sum-ii
You are given a string s of length m consisting of digits. You are also given a 2D integer array queries, where queries[i] = [li, ri]. For each queries[i], extract the substring s[li..ri]. Then, perform the following:
leetcode.cn 2026-07-09
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
Telegraph
path-existence-queries-in-a-graph-i
给你一个整数 n,表示图中的节点数量,这些节点按从 0 到 n - 1 编号。 同时给你一个长度为 n 的整数数组 nums,该数组按 非递减 顺序排序,以及一个整数 maxDiff。 如果满足 |nums[i] - nums[j]| <= maxDiff(即 nums[i] 和 nums[j] 的 绝对差 至多为 maxDiff),则节点 i 和节点 j 之间存在一条 无向边 。 此外,给你一个二维整数数组 queries。对于每个 queries[i] = [ui, vi],需要判断节点 ui 和 vi…
leetcode.com 2026-07-09
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
Telegraph
path-existence-queries-in-a-graph-i
You are given an integer n representing the number of nodes in a graph, labeled from 0 to n - 1. You are also given an integer array nums of length n sorted in non-decreasing order, and an integer maxDiff. An undirected edge exists between nodes i and j if…
leetcode.cn 2026-07-10
🔴3534.path-existence-queries-in-a-graph-ii
🏷️ Tags
#greedy #bit_manipulation #graph #array #two_pointers #binary_search #dynamic_programming #sorting
🔴3534.path-existence-queries-in-a-graph-ii
🏷️ Tags
#greedy #bit_manipulation #graph #array #two_pointers #binary_search #dynamic_programming #sorting
Telegraph
path-existence-queries-in-a-graph-ii
给你一个整数 n,表示图中的节点数量,这些节点按从 0 到 n - 1 编号。 同时给你一个长度为 n 的整数数组 nums,以及一个整数 maxDiff。 如果满足 |nums[i] - nums[j]| <= maxDiff(即 nums[i] 和 nums[j] 的 绝对差 至多为 maxDiff),则节点 i 和节点 j 之间存在一条 无向边 。 此外,给你一个二维整数数组 queries。对于每个 queries[i] = [ui, vi],找到节点 ui 和节点 vi 之间的 最短距离 。如果两节点之间不存在路径,则返回…
leetcode.com 2026-07-10
🔴3534.path-existence-queries-in-a-graph-ii
🏷️ Tags
#greedy #bit_manipulation #graph #array #two_pointers #binary_search #dynamic_programming #sorting
🔴3534.path-existence-queries-in-a-graph-ii
🏷️ Tags
#greedy #bit_manipulation #graph #array #two_pointers #binary_search #dynamic_programming #sorting
Telegraph
path-existence-queries-in-a-graph-ii
You are given an integer n representing the number of nodes in a graph, labeled from 0 to n - 1. You are also given an integer array nums of length n and an integer maxDiff. An undirected edge exists between nodes i and j if the absolute difference between…
leetcode.cn 2026-07-11
🟡2685.count-the-number-of-complete-components
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #graph
🟡2685.count-the-number-of-complete-components
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #graph
Telegraph
count-the-number-of-complete-components
给你一个整数 n 。现有一个包含 n 个顶点的 无向 图,顶点按从 0 到 n - 1 编号。给你一个二维整数数组 edges 其中 edges[i] = [ai, bi] 表示顶点 ai 和 bi 之间存在一条 无向 边。 返回图中 完全连通分量 的数量。 如果在子图中任意两个顶点之间都存在路径,并且子图中没有任何一个顶点与子图外部的顶点共享边,则称其为 连通分量 。 如果连通分量中每对节点之间都存在一条边,则称其为 完全连通分量 。 示例 1: 输入:n = 6, edges = [[0,1],[0…
leetcode.com 2026-07-11
🟡2685.count-the-number-of-complete-components
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #graph
🟡2685.count-the-number-of-complete-components
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #graph
Telegraph
count-the-number-of-complete-components
You are given an integer n. There is an undirected graph with n vertices, numbered from 0 to n - 1. You are given a 2D integer array edges where edges[i] = [ai, bi] denotes that there exists an undirected edge connecting vertices ai and bi. Return the number…
leetcode.cn 2026-07-14
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
Telegraph
find-the-number-of-subsequences-with-equal-gcd
给你一个整数数组 nums。 请你统计所有满足以下条件的 非空 子序列 对 (seq1, seq2) 的数量:
leetcode.com 2026-07-14
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
Telegraph
find-the-number-of-subsequences-with-equal-gcd
You are given an integer array nums. Your task is to find the number of pairs of non-empty subsequences (seq1, seq2) of nums that satisfy the following conditions: