[Leetcode] 200. Number of Islands
·
코딩테스트/Python
🔗 Problem Link Number of Islands - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com ❔Thinking 0은 물, 1은 땅을 나타내는 grid가 주어질 때, 섬의 개수를 반환한다. 💻Solution 1. while을 활용한 DFS 풀이 def numIslands(grid: List[List[str]]) -> int: island = 0 m, n = len(grid), len(grid[0]) for i in range(m): for j in..