-
Notifications
You must be signed in to change notification settings - Fork 743
๐ 2๋จ๊ณ - ์ฌ๋ค๋ฆฌ(์์ฑ) #2427
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
Conversation
javajigi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2๋จ๊ณ ๋ฏธ์
์งํํ๋๋ผ ์๊ณ ํ์ด์. ๐
์๊ตฌ์ฌํญ์ ๋ณต์ก๋๊ฐ ๋์ง ์์ ๋ฐ๋ก mergeํ๋ ค๋ค ์๋ก์ด ๊ฐ์ฒด๋ฅผ ๋์ถํ์ผ๋ฉด ํ๋ ํผ๋๋ฐฑ์ด ์์ด ํผ๋๋ฐฑ ๋ฐ์ ํ 3๋จ๊ณ ์งํํ๋ฉด ์ข๊ฒ ๋ค์.
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class Height { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐
| private final Position row; | ||
| private final Position column; | ||
|
|
||
| public Ladder(int row, int column) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ถ์์ฑ์ ๐
| @@ -0,0 +1,41 @@ | |||
| package nextstep.ladder.domain.ladder; | |||
|
|
|||
| public class Ladder implements Comparable<Ladder> { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๊ฐ์ฒด ์ด๋ฆ์ด Ladder์ด๋ค๋ณด๋ ์ฌ๋ค๋ฆฌ ์ ์ฒด๋ก ์ธ์ํ ๊ฐ๋ฅ์ฑ์ด ์์ด ๋ณด์
ํน์ ์ง์ ์ ์๋ฏธํ๋ ๊ฒ์ผ๋ก Point์ ๊ฐ์ ์ด๋ฆ์ ์ด๋จ๊น?
AI๋ฅผ ํตํด ํผ๋๋ฐฑ ๋ฐ์๋ณธ ํ ๋ฆฌํฉํฐ๋งํด๋ณธ๋ค.
|
|
||
| private static final Random RANDOM = new Random(); | ||
|
|
||
| public static TreeMap<Ladder, Boolean> createLadders(int width, int height) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2์ค for๋ฌธ์ผ๋ก ๊ตฌํํ๊ธฐ ๋ณด๋ค Line๊ณผ ๊ฐ์ ์๋ก์ด ๊ฐ์ฒด๋ฅผ ์ถ๊ฐํด 2์ค for๋ฌธ์ ์ ๊ฑฐํด ๋ณด๋ฉด ์ด๋จ๊น?
| private static final Random RANDOM = new Random(); | ||
|
|
||
| public static TreeMap<Ladder, Boolean> createLadders(int width, int height) { | ||
| TreeMap<Ladder, Boolean> map = new TreeMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๋ณดํต Map์ ๊ตฌํ์ฒด๋ก HashMap์ ์ฌ์ฉํ๋๋ฐ TreeMap์ ์ด ์ด์ ๋?
์ด ๋ก์ง์ HashMap๊ณผ TreeMap ์ค ์ด๋ ๊ตฌํ์ฒด๊ฐ ์ ํฉํ์ง๋ฅผ AI๋ฅผ ํตํด ํผ๋๋ฐฑ์ ๋ฐ์๋ณด๊ณ ์ ์ฉํด ๋ณธ๋ค.
์ด๋ฐ ๋ถ๋ถ์ ๊ถ๊ธ์ฆ์ AI ๋์์ ๋ฐ์ ํด์ํ๋ ๊ฒฝํ์ ์ด์ด๊ฐ ๊ฒ์ ์ถ์ฒํ๋ค.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HashMap์ด ์๋ TreeMap์ ์ฌ์ฉํ ์ด์ ๋ ์ฝ์์ ์ฌ๋ค๋ฆฌ๋ฅผ ์ถ๋ ฅํ๊ธฐ ์ํด ์์๋ฅผ ๋ณด์ฅํ๋ฉด์ ๊ด๋ฆฌ๋๋ฉด ์ข๊ฒ ๋ค๊ณ ์๊ฐ๋์๊ณ , HashMap์ ์ฌ์ฉํ์ ๊ฒฝ์ฐ ์ฝ์์ ์ถ๋ ฅ ์ ์ ๋ ฌ์ ์งํํ ๋ค ์ถ๋ ฅํด์ผ ๋๋ค๊ณ ํ๋จ๋์ด TreeMap์ ์ ํํ๊ฒ ๋์์ต๋๋ค.
AI์๊ฒ ์ง๋ฌธํ๋ HashMap์ด ๊ฒฐ๊ณผ์ ์ผ๋ก ๋ฉ๋ชจ๋ฆฌ ํจ์จ์ฑ ์ธก๋ฉด์์ ๋ ์ข๋ค๋ ๊ฒฐ๊ณผ๊ฐ ๋์์ต๋๋ค.
|
๋จ๊ฒจ์ฃผ์ ํผ๋๋ฐฑ์ ์์ ํ๋ ์ค ๋ ํจ์จ์ ์ธ ๋ก์ง์ ์๊ฐํด ์์ ํ์ต๋๋ค.
|
javajigi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ํผ๋๋ฐฑ ๋ฐ์ ๐
์ด๋ฒ ๋ฏธ์
์ ๋ฉ์ธ์ด 3๋จ๊ณ์ธ๋งํผ 3๋จ๊ณ ๋ฏธ์
๋์ ํด ๋ณด์์ฃ .
์๋ ํ์ธ์ ! 2๋จ๊ณ - ์ฌ๋ค๋ฆฌ(์์ฑ) ๋ฆฌ๋ทฐ ์์ฒญ๋๋ฆฝ๋๋ค. ๐โโ๏ธ
๊ณผ์ ์งํ ๋ด์ฉ ์ ๋ฆฌ