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

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

jiixon
Copy link
Member

@jiixon jiixon commented Apr 11, 2024

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

<ํ…Œ์ŠคํŠธ์ฝ”๋“œ>
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
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
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์ž๋ฆฌ๋ฅผ ์ด๋™ํ•ด ์„œ๋กœ์—๊ฒŒ ์ธ์‚ฌํ•ด์ฃผ์„ธ์š”.";

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