Friend Circle

分析

并查集,比较number of island,这里是两两关系会有重复,不能四个方向伸展,不像island,都是独立的点。

这里total /= 2;

python

Last updated

Was this helpful?