Conversation
moongua404
reviewed
Feb 9, 2025
moongua404
left a comment
There was a problem hiding this comment.
시간이 부족했을텐데 lean하게(?) 기능을 구현하신 것 같아요!
1주차 미션 수고많으셨습니다
| for(int i=1;i<delimiters.length;i++){ | ||
| delimiterRegex+="|"; | ||
| delimiterRegex+=delimiters[i]; | ||
| } |
| for(int j=0;j<numberslenth;j++){ | ||
| int real =Integer.parseInt(numbers[j]); | ||
| sum+=real; | ||
| } |
There was a problem hiding this comment.
인덱스 접근으로 할 필요가 있을까요? 원소를 순회하는 방식으로 하는게 더 좋을 것 같아요!
| System.out.println("sum = "+sum); | ||
| } | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
주석을 단 부분들을 함수로 빼면 좀 더 가독성이 좋을 것 같아요!
| String newdelimiter=""; | ||
| int newdelimitersize=0; | ||
| if(input.startsWith("//")){ | ||
| int customendIndex=input.indexOf("\\n"); |
|
고생 많으셨습니다. |
KIM-GOING
reviewed
Feb 11, 2025
KIM-GOING
left a comment
There was a problem hiding this comment.
자바라는 언어가 프로그래밍되는 스타일이 어떤지 공부하며 코드를 작성하면 더욱 도움이 될 수 있을 거 같습니다. 수고하셨습니다:)
| System.out.println("sum = "+sum); | ||
| } | ||
| } | ||
| } No newline at end of file |
szoon2426
reviewed
Feb 12, 2025
| // -> 얘는 밑에 코드를 while문안에 넣어놓고 조건을 문장의 첫 부분이 \가 아닐때까지로 하면되지않을까..? | ||
| //그냥 커스텀 구분자는 입력 하나에 하나만 있다고 해야지...ㅎㅅㅎ | ||
| String newdelimiter=""; | ||
| int newdelimitersize=0; |
| // -> 얘는 밑에 코드를 while문안에 넣어놓고 조건을 문장의 첫 부분이 \가 아닐때까지로 하면되지않을까..? | ||
| //그냥 커스텀 구분자는 입력 하나에 하나만 있다고 해야지...ㅎㅅㅎ | ||
| String newdelimiter=""; | ||
| int newdelimitersize=0; |
There was a problem hiding this comment.
변수명 지을때 newDelimiterSize 처럼 원래 띄어쓰기 해야되는 부분을 대문자로 표기하는 카멜케이스를 적용하면 더 좋을 것 같습니다
| throw new IllegalArgumentException("Error"); | ||
| } | ||
| newdelimiter = input.substring(2, customendIndex); // "//" 이후와 "\n" 사이 추출 | ||
| String[] newDelimiters = new String[delimiters.length + 1]; //배열 복사를 위한 새로운 배열 생성 |
There was a problem hiding this comment.
newdelimiter와 newDelimiters 가 이름이 비슷해서 헷갈릴 것 같아요
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.
No description provided.