LeetCode 200. Number of Islands | JSer - JavaScript & Algorithm

preview_player
Показать описание
Typical graph problem. to count isolated sub tree count, just use bfs/dfs to mark connected node/points. and then count the process

Hi I'm a JavaScript engineer who is not good at algorithms,
and currently practicing leetCode online. If you are interested, maybe we can learn together.
Рекомендации по теме
Комментарии
Автор

actually you could have solved it without the walked []
by switching every 1 to 0 after you walk on it

eziotv
welcome to shbcf.ru