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

3단계 - 로또(2등) east #4170

Merged
merged 15 commits into from
Apr 8, 2025
Merged

Conversation

ehdrylang
Copy link

image

위와 같이 나와서 리뷰요청 PR 또 올립니다;;

Copy link

@shared-moon shared-moon left a comment

Choose a reason for hiding this comment

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

동교님 안녕하세요!
3단계 미션 잘 진행 해 주셨네요 :)
앞에서 구조를 잘 잡아주셔서 크게 피드백 드릴 부분은 없었던 것 같아요
간단한 코멘트를 좀 남겨 뒀는데, 확인 후 다음 미션 진행 해 주세요!
고생 많으셨습니다 :)

WinningNumbers winningNumbers = new WinningNumbers(InputView.readWinningNumbers("지난 주 당첨 번호를 입력해 주세요."));
String inputWinningNumbers = InputView.readWinningNumbers("지난 주 당첨 번호를 입력해 주세요.");
int bonusNumber = InputView.readBonusNumber("보너스 볼을 입력해 주세요.");
WinningNumbers winningNumbers = new WinningNumbers(inputWinningNumbers, bonusNumber);

Choose a reason for hiding this comment

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

👍

if (Reward.FIRST.matchCount == matchResult.count()) {
return FIRST;
}
if (Reward.SECOND.matchCount == matchResult.count()) {

Choose a reason for hiding this comment

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

bonusMatch에 대한 정보를 각 enum 객체에서 관리해서 count와 보너스 매칭 여부를 다 판단하던가 SECOND를 먼저 판단하고 SECOND를 제외한 요소들을 순회하면서 원래처럼 카운트 하는 방식으로 바꿔보면 어떨까요 ?

.map(Reward::valueOf)
.collect(Collectors.toUnmodifiableList());
.collect(Collectors.toUnmodifiableMap(reward -> reward, reward -> 1, Integer::sum));

Choose a reason for hiding this comment

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

Collectors.counting() 을 이용해보면 어떨까요 ?

@shared-moon shared-moon merged commit 60e7b14 into next-step:ehdrylang Apr 8, 2025
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