Skip to content

Conversation

@jungmyunggi
Copy link
Collaborator

문제

Type Info
Time Complexity O(n*m)
Space Complexity O(n*m)
Algorithm flood fill
Data Structure x

Constraints

  • m == land.length
  • n == land[i].length
  • 1 <= m, n <= 300
  • land consists of only 0's and 1's.
  • Groups of farmland are rectangular in shape.

Edge Case

  • x

풀이

  1. 현재 탐색중인 노드가 0이거나 이미 방문한 노드면 continue
  2. x축 방향으로 0이 나올 때 까지 확장, y축 방향으로 0이 나올 때 까지 확장
  3. 농지그룹은 무조건 직사각형 형태이기 때문에 2에서 찾은 x,y가 하나의 그룹이 됨

어려웠던 점

  • x

알게된 점

  • x

@jungmyunggi jungmyunggi self-assigned this Feb 8, 2025
@github-actions github-actions bot merged commit c4776d1 into main Feb 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants