Skip to content

[BE] ์ธ์ง€์› ๐Ÿ‘ฅ ์˜ค๋Š˜์˜ ์ง๊ฟ์€?#24

Open
jiixon wants to merge 8 commits into
Leets-Official:mainfrom
jiixon:jiixon
Open

[BE] ์ธ์ง€์› ๐Ÿ‘ฅ ์˜ค๋Š˜์˜ ์ง๊ฟ์€?#24
jiixon wants to merge 8 commits into
Leets-Official:mainfrom
jiixon:jiixon

Conversation

@jiixon

@jiixon jiixon commented Apr 11, 2024

Copy link
Copy Markdown
Member

๋ฏธ์…˜์‹คํ–‰๊ฒฐ๊ณผ

<ํ…Œ์ŠคํŠธ์ฝ”๋“œ>
image

<์‹คํ–‰๊ฒฐ๊ณผ>
image

๊ธฐ๋Šฅ๋ช…์„ธ์„œ

@jiixon jiixon self-assigned this Apr 11, 2024
Comment on lines 88 to +101
public void printResult(List<List<String>> result) {
StringBuilder sb = new StringBuilder();

for(int i=0; i<result.size(); i++){
sb.append("[ ");
for(int j=0; j<result.get(i).size(); j++){
sb.append(result.get(i).get(j));
if(j<result.get(i).size()-1) sb.append(" | ");
}
sb.append(" ]");
sb.append("\n");
}
System.out.println(sb);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StringJoiner ์‚ฌ์šฉ๋„ ๊ณ ๋ คํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!!

Comment on lines +75 to +85
int column = maximumGroupSize;
int row = (memberList.size() + column - 1) / column;


for (int i = 0; i < row; i++) {
resultList.add(new ArrayList<>());
for (int j = i*column; j < column*(i+1); j++) {
if(j<memberList.size()) resultList.get(i).add(memberList.get(j));
}
}
return resultList;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋‹ค์ค‘ for ๋ฌธ์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹ ๋ง๊ณ  ๋นˆ ArrayList์— member๋ฅผ ๋„ฃ์–ด์ฃผ๋‹ค๊ฐ€ maximumGroupSize๊ฐ€ ๋˜๋ฉด ํ•ด๋‹น ๋ฆฌ์ŠคํŠธ๋ฅผ resultList์— ๋„ฃ๋Š” ๋ฐฉ์‹๋„ ๊ณ ๋ คํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค

Comment on lines +8 to +9
private static final String START_MESSAGE = "[Leets ์˜ค๋Š˜์˜ ์ง์—๊ฒŒ]๋ฅผ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.\n";
private static final String GOODBYE_MESSAGE = "์ถ”์ฒจ์„ ์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค.\n์ž๋ฆฌ๋ฅผ ์ด๋™ํ•ด ์„œ๋กœ์—๊ฒŒ ์ธ์‚ฌํ•ด์ฃผ์„ธ์š”.";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ถœ๋ ฅ ๋ฉ”์‹œ์ง€๋ฅผ System.out.println("์ถ”์ฒจ์„ ์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค"); ์ด๋Ÿฐ ์‹์ด ์•„๋‹Œ ๋”ฐ๋กœ ๋ณ€์ˆ˜๋กœ ์ง€์ •ํ•˜์—ฌ System.out.println(GOODBYE_MESSAGE); ์ด๋Ÿฐ ์‹์œผ๋กœ ํ•˜์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants