Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LeetCode - Medium] Find All Groups of Farmland #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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

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.

1 participant