Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π λ¬Έμ λ§ν¬
μ΄μ
βοΈ μμλ μκ°
40λΆ
β¨ μλ μ½λ
μ΄μ μ νμλ νμ₯ λ¬Έμ μ λ§€μ° μ μ¬νλ€.
κ·Όλ° μ§κΈ μμ λ€μ ν΄λΉ PRμ μ½μ΄λ³΄λ μ무λ νμ₯ λ¬Έμ λ₯Ό νΌ μ¬λμ΄ μμλ€..
... λ€μ μ²μ²ν μ€λͺ μ ν΄λλ¦¬κ² λ€.
ν΅μ¬ λ‘μ§μ λ€μκ³Ό κ°λ€.
λΉλ©μ κ°μ₯μ리 μΈλΆμ λΉλ© μνμ λμλ€λ μ μλ€.
λ μμ΄λμ΄λ₯Ό μ΄λ»κ² ν΄κ²°νλλ ?μ κ°μ μ λ³΄κ° μ£Όμ΄μ‘μ λ,
μΈκ³½μ
"."
μ λλ¬μ€μΌλ‘μ¨ μμ°μ€λ½κ² μ€κ³ κ° μ μλλ‘ ν μ μλ€.κ·Έλ¬λ©΄
(0, 0)
μ νμ λΉ κ³΅κ°μ΄λ―λ‘ μμ μ§μ μ(0, 0)
μμ μ§μ μΌλ‘ μ‘κ³ BFS λ₯Ό λλ € μ€λ€.μ΄λ κ² BFSλ₯Ό λ리λ€κ°, λ¬Έ(λλ¬Έμ) λ₯Ό λ§λ¬μ κ²½μ°, κ°μ§κ³ μλ ν€λ‘ μ΄ μ μλ μ§ νμΈνλ€.
μ΄ μ μμΌλ©΄ ν΄λΉ λ¬Έμ λ°λ²λ¦¬κ³ μ§μ νκ³ , λ§μ½ λ¬Έμ μ΄ μ μμ κ²½μ° μ΄ μ μλ λ¬Έ λͺ©λ‘μ λ±λ‘νλ€.
μ΄ μ μλ λ¬Έ λͺ©λ‘μ λ±λ‘νλ μ΄μ λ,
μ§κΈμ κ° μ μμ§λ§ μΆνμ μ΄μ λ₯Ό μ»μμ κ²½μ° λ°λ‘ ν΄λΉ μ’νλ₯Ό νμ μ½μ νκΈ° μν¨μ΄λ€.
μ΄ν BFSλ₯Ό λ리λ€κ°, μ΄μ (μλ¬Έμ) λ₯Ό λ§λ¬μ κ²½μ°, ν΄λΉ μ΄μ λ₯Ό κ°μ§κ³ μ΄ μ μλ λ¬Έμ΄ μλμ§
μ΄ μ μλ λ¬Έ λͺ©λ‘
μμ νμΈνλ€.λ§μ½ μ΄ μ μλ λ¬Έμ΄ μμ κ²½μ° λ°λ‘ νμ μ½μ νκ³ ,
μ΄ μ μλ λ¬Έμ΄ μ‘΄μ¬νμ§ μμ κ²½μ° κ°μ§κ³ μλ ν€ λͺ©λ‘μ ν΄λΉ ν€λ₯Ό μΆκ°νλ€.
μ λ‘μ§λ§ μΆκ°νλ©΄ μΌλ° BFSλ λκ°λ€.
ν΄λΉ λ¬Έμ μ μμ νΈν λ¬Έμ κ° μμμ μΈκΈν νμ₯ λ¬Έμ μ΄λ ν λ² λμ ν΄λ³΄κΈΈ λ°λλ€!
π μλ‘κ² μκ²λ λ΄μ©