827. Making A Large Island

Description

Here

Intuition

这道题最快的solution就是去label不同的的island,然后重新再扫描一边,看看连接的最大面积

Pitfall

一个小坑,

[
      [0, 1],
      [0, 1]
]

容易变成 1 + 3 + 3, 需要dedup一下

Solution

Reference

results matching ""

    No results matching ""