손영빈 // 기존코드 객체화 진행#10
Open
ybin4548 wants to merge 5 commits into
Open
Conversation
Comment on lines
+17
to
+20
| guard let input = readLine(), | ||
| let num = Optional(input.compactMap{Int(String($0))}), //숫자 외의 다른 값이 들어왔는지 확인, map 대신 compactMap 사용 : map 사용시 nil로 처리 되기 때문에 처리가 바르게 일어나지않음(ex. 1ab입력시 num = [1,nil,nil] -> 중복으로 처리됨 | ||
| num.count == 3 | ||
| else { |
There was a problem hiding this comment.
입력 된 문자열을 처리하는 코드를 guard 안에서 처리하려고 Optinal로 감싸신 것 같은데
let num = readLine().map({ $0.compactMap(\.wholeNumberValue) })이렇게 처리하면 좋을 것 같네요.
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.
기존 코드 수정, 객체화 진행했습니다.
기본적으로, 코드는 지난번에 사용된 코드를 거의 그대로 사용하도록 구현했습니다.
지난 코드와 비교하실 수 있도록 브랜치 하나 새로 파서 pr 남깁니다.