leetcode.com 2026-07-04
🟡2492.minimum-score-of-a-path-between-two-cities
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #graph
🟡2492.minimum-score-of-a-path-between-two-cities
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #graph
Telegraph
minimum-score-of-a-path-between-two-cities
You are given a positive integer n representing n cities numbered from 1 to n. You are also given a 2D array roads where roads[i] = [ai, bi, distancei] indicates that there is a bidirectional road between cities ai and bi with a distance equal to distancei.…
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-08-05
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
Telegraph
remove-methods-from-project
你正在维护一个项目,该项目有 n 个方法,编号从 0 到 n - 1。 给你两个整数 n 和 k,以及一个二维整数数组 invocations,其中 invocations[i] = [ai, bi] 表示方法 ai 调用了方法 bi。 已知如果方法 k 存在一个已知的 bug。那么方法 k 以及它直接或间接调用的任何方法都被视为 可疑方法 ,我们需要从项目中移除这些方法。 只有当一组方法没有被这组之外的任何方法调用时,这组方法才能被移除。 返回一个数组,包含移除所有 可疑方法 后剩下的所有方法。你可以…
leetcode.com 2026-08-05
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
Telegraph
remove-methods-from-project
You are maintaining a project that has n methods numbered from 0 to n - 1. You are given two integers n and k, and a 2D integer array invocations, where invocations[i] = [ai, bi] indicates that method ai invokes method bi. There is a known bug in method k.…
leetcode.cn 2026-09-01
🟡3568.minimum-moves-to-clean-the-classroom
🏷️ Tags
#bit_manipulation #breadth_first_search #array #hash_table #matrix
🟡3568.minimum-moves-to-clean-the-classroom
🏷️ Tags
#bit_manipulation #breadth_first_search #array #hash_table #matrix
Telegraph
minimum-moves-to-clean-the-classroom
给你一个 m x n 的网格图 classroom,其中一个学生志愿者负责清理散布在教室里的垃圾。网格图中的每个单元格是以下字符之一:
leetcode.com 2026-09-01
🟡3568.minimum-moves-to-clean-the-classroom
🏷️ Tags
#bit_manipulation #breadth_first_search #array #hash_table #matrix
🟡3568.minimum-moves-to-clean-the-classroom
🏷️ Tags
#bit_manipulation #breadth_first_search #array #hash_table #matrix
Telegraph
minimum-moves-to-clean-the-classroom
You are given an m x n grid classroom where a student volunteer is tasked with cleaning up litter scattered around the room. Each cell in the grid is one of the following:
leetcode.com 2026-09-25
🔴1096.brace-expansion-ii
🏷️ Tags
#stack #breadth_first_search #hash_table #string #backtracking #sorting
🔴1096.brace-expansion-ii
🏷️ Tags
#stack #breadth_first_search #hash_table #string #backtracking #sorting
Telegraph
brace-expansion-ii
Under the grammar given below, strings can represent a set of lowercase words. Let R(expr) denote the set of words the expression represents. The grammar can best be understood through simple examples:
leetcode.cn 2026-10-07
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
Telegraph
remove-invalid-parentheses
给你一个由若干括号和字母组成的字符串 s ,删除最小数量的无效括号,使得输入的字符串有效。 返回所有可能的结果。答案可以按 任意顺序 返回。 示例 1: 输入:s = "()())()" 输出:["(())()","()()()"] 示例 2: 输入:s = "(a)())()" 输出:["(a())()","(a)()()"] 示例 3: 输入:s = ")(" 输出:[""] 提示:
leetcode.com 2026-10-07
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
🔴301.remove-invalid-parentheses
🏷️ Tags
#breadth_first_search #string #backtracking
Telegraph
remove-invalid-parentheses
Given a string s that contains parentheses and letters, remove the minimum number of invalid parentheses to make the input string valid. Return a list of unique strings that are valid with the minimum number of removals. You may return the answer in any order.…