↓Skip to main content

Dfs

LeetCode 3619: Count Islands With Total Value Divisible by K
·2 mins
LeetCode Medium Dfs Bfs Matrix Graph
LeetCode 3619 note: flood fill each island and sum its values; with up to 10^5 cells, iterate to avoid deep recursion
LeetCode 200: Number of Islands
·1 min
LeetCode Medium Dfs
LeetCode Problem Solving
LeetCode 547: Number of Provinces
·3 mins
LeetCode Medium Union-Find Dfs
LeetCode Problem Solving
LeetCode 3493: Properties Graph
·2 mins
LeetCode Medium Graph Dfs Union-Find Hash-Map
LeetCode 3493 note: convert each row to a set, compare intersection sizes pairwise to add edges, then count components