[BE] ๊น์์ฐฌ ๐ฅ ์ค๋์ ์ง๊ฟ์?#14
[BE] ๊น์์ฐฌ ๐ฅ ์ค๋์ ์ง๊ฟ์?#14yechan-kim wants to merge 5 commits intoLeets-Official:mainfrom
Conversation
taeseokyang
left a comment
There was a problem hiding this comment.
๋ก์ง์ ์์ฑํ ํ, GPT์๊ฒ ๊ฐ์ ์ ์์ฒญ ํด๋ณด์๋๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค! GPT๋ ์ข์ ์ฝ๋๋ฆฌ๋ทฐ์ด์ด๊ณ , ๊ฐ์ ๊ฒฐ๊ณผ์์ ๋ฐฐ์ฐ๋ ๊ฒ์ด ๋ง์ต๋๋ค.
๋๋ค ๊ทธ๋ฃน ๋งค์นญ ํจ์ ๋ก์ง์ ๊ฐ์ ํด๋ณด์๋ ๊ฑธ ์ถ์ฒ๋๋ฆฝ๋๋ค!!
์๊ณ ํ์ จ์ต๋๋ค!
| System.out.println("[Leets ์ค๋์ ์ง์๊ฒ]๋ฅผ ์์ํฉ๋๋ค."); | ||
|
|
||
| System.out.println("\n์ฐธ์์๋ค์ ์ด๋ฆ์ ์ ๋ ฅํด ์ฃผ์ธ์. (,๋ก ๊ตฌ๋ถ)"); | ||
| String inputStr = sc.nextLine(); |
There was a problem hiding this comment.
์ด๋ค ์ ๋ ฅ์ธ์ง ์ ์ ์๋ ๋ณ์๋ช ์ด๋ฉด ๋์ฑ ์ข์๊ฑฐ ๊ฐ์ต๋๋ค!
memberNamesInput ๋ ์ด๋จ๊น์?
| checkDataValidity(memberNumber(members), maximumGroupSize); | ||
| System.out.println(); | ||
|
|
||
| boolean result = true; |
There was a problem hiding this comment.
๋ณ์๋ช ์ด ์ ์ ํ์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค! ๊ฒฐ๊ณผ๊ฐ ๊ฑฐ์ง, ์ง์ค์ ์๋๊ธฐ ๋๋ฌธ์ ๋๋ค.
isDone ๊ฐ์ ๋ณ์๋ ์ด๋ค๊ฐ์? booleanํ ๋ณ์๋ ์์ is๋ฅผ ๋ถ์ด๋ฉด ์ฝ๊ธฐ ์ฝ์ต๋๋ค!
ay-eonii
left a comment
There was a problem hiding this comment.
1์ฃผ์ฐจ ๋ฏธ์
๊ณ ์ํ์
จ์ต๋๋ค๐ฅณ
์๊ตฌ์ฌํญ์ ๋๋ฌด ์ ์ง์ผ์ฃผ์
จ๋ค์!
| Scanner sc = new Scanner(System.in); | ||
| System.out.println("[Leets ์ค๋์ ์ง์๊ฒ]๋ฅผ ์์ํฉ๋๋ค."); | ||
|
|
||
| System.out.println("\n์ฐธ์์๋ค์ ์ด๋ฆ์ ์ ๋ ฅํด ์ฃผ์ธ์. (,๋ก ๊ตฌ๋ถ)"); |
There was a problem hiding this comment.
๊ฐํ๋ฌธ์๋ฅผ \n๋ก ๋์์ ๋ ์ด๋ค ๋ฌธ์ ๊ฐ ์์๊น์?
| } | ||
|
|
||
| // ๋ค์ ์ถ์ฒ์ ํ ์ง ๋ฌผ์ด๋ณด๋ ํจ์์ ๋๋ค. | ||
| public boolean ask(String operator) throws Exception { |
There was a problem hiding this comment.
ask์๋ ์ฌ์ถ์ฒจ ์ฌ๋ถ๋ผ๋ ์๋ฏธ๊ฐ ์ ๋ด๊ฒจ์์ง ์์ ๊ฒ ๊ฐ์์ ๐ฅฒ
| Collections.shuffle(memberList); | ||
|
|
||
| List<List<String>> result = new ArrayList<>(); | ||
| List<String> temp = new ArrayList<>(); |
There was a problem hiding this comment.
์กฐ๊ธ๋ ์๋ฏธ๋ฅผ ๋ด์ ๋ณ์๋ช ์ ๋ง๋ค์ด์ฃผ์๋ฉด ๋ค๋ฅธ ์ฌ๋์ด ์ฝ๋ ์ฝ์ ๋ ์ดํด๊ฐ ์ฌ์ธ ๊ฒ ๊ฐ์์๐
| for (List<String> group : result) { | ||
| sb.append("["); | ||
|
|
||
| for (int i = 0; i < group.size() - 1; i++) { | ||
| sb.append(" ").append(group.get(i)).append(" |"); | ||
| } | ||
|
|
||
| sb.append(" ").append(group.get(group.size() - 1)).append(" ]\n"); | ||
| } |
There was a problem hiding this comment.
StringJoiner์ ๋ํด ์์๋ณด์๋ฉด ๋์์ด ๋ ๊ฒ ๊ฐ์์ ๐
| else if (operator.equals("y")){ | ||
| System.out.println("--------------------------------"); | ||
| return true; | ||
| } |
There was a problem hiding this comment.
early return ํจํด์ด๋ผ๋ฉด else๊ฐ ํ์์์ด ๋ณด์ด๋ค์๐
๋ฏธ์ ์คํ ๊ฒฐ๊ณผ
[ํ ์คํธ ์คํ ํฐ๋ฏธ๋ ์บก์ณ ์ด๋ฏธ์ง ํ์ผ ์ฒจ๋ถ]

[ํ ์คํธ]
[์คํ๊ฒฐ๊ณผ]

๋ฏธ์ ์คํ ์คํจ ์ผ์ด์ค ์กด์ฌ ์, ์คํจํ ์ด์ ๊ณ ์ฐฐํด๋ณด๊ธฐ
์ ์ ์๋
๊ธฐ๋ฅ ๋ช ์ธ์