https://leetcode.com/study-plan/leetcode-75
Day 20
Accepted
Accepted
Day 19
Accepted
- We can treat this problem as counting the total size of an interconnected graph nodes; representing stones as the node with their connection to each other:
- stone
i
with coordinate [xi, yi]
is connected to stone j
with coordinate [xj, yj]
if xi === yi OR yi === yj
- We count the size of interconnected stones using DFS, decreasing it with 1 for each “island” because we can’t remove the last stone or the stone that has no connection to other stones
Accepted
Day 18
Accepted