Open
Conversation
Collaborator
|
map에 미리 패턴의 빈도수를 저장해두는 방법은 생각을 못했었는데 좋은 것 같습니다. ssafy_algorithm_study/src/week8/BJ1034Lamp/Main.java Lines 36 to 42 in cd320b9 위 코드를 getOrDefault()를 사용하면 아래 코드와 같이 한 줄로 작성할 수 있습니다.
|
Owner
Author
|
감사합니다 문제풀당시 로직이 머리속에 정리 되지 않아 쭉 생각대로 작성했는데 이렇게 줄일수 있군요 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
풀이
K 가 짝수면 그대로 유지 되기때문에 현재 켜진 갯수를 새서 출력하면됩니다.
(44번째 줄에서 70번째줄)
0의 갯수가 얼마나 패턴에 존재하는지 확인하여리뷰 요청 사항
느낀점