Number of Islands (1) 썸네일형 리스트형 LeetCode: 200번 (Number of Islands) [JAVA] 문제 링크 https://leetcode.com/problems/number-of-islands/ 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 풀이 전체적인 풀이 과정은 다음과 같다. 반환할 answer 값 0으로 초기화 bfs 기반으로 주어진 grid를 탐색, 전체 grid를 돌며 해당 위치가 '1'인 경우 큐에 해당 위치를 넣고 bfs를 진행하여 현재 '1'과 연결된 위치의 값들을 모두 찾아 '0'으로 초기화한다. 이후 .. 이전 1 다음