Skip to content

[PGS] JadenCase_문자열_만들기 - #63

Open
gayo73 wants to merge 1 commit into
mainfrom
gayo-#12
Open

[PGS] JadenCase_문자열_만들기#63
gayo73 wants to merge 1 commit into
mainfrom
gayo-#12

Conversation

@gayo73

@gayo73 gayo73 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

🍪 문제 이름

Resolve: https://school.programmers.co.kr/learn/courses/30/lessons/12951


🍊 문제 정의

input

  • 문자열 s

output

  • s를 JadenCase로 바꾼 문자열을 리턴

🍑 알고리즘 설계

처음에는 split()으로 공백 제외 단어 단위로 대문자 변환하려했는데 공백이 연속으로 들어올 수 있어서 이전 문자열이 공백이고 자신은 공백이 아닌 문자만 substring으로 대문자로 바꿨습니다.
근데 stringBuilder를 사용하는 것도 좋을 것 같습니다

answer += s.substring(0, 1).toUpperCase();
        for(int i=1; i<s.length(); i++){
            if(s.substring(i-1, i).equals(" ") && !s.substring(i, i+1).equals(" ")){
                answer += s.substring(i, i+1).toUpperCase();
            }
            else{
                answer += s.substring(i, i+1).toLowerCase();
            }
        }

🥝 최악 수행 시간 복잡도

  • O()

🍰 특이 사항 (Optional)

참고 자료나 추가로 설명하고 싶은 내용을 작성해 주세요.

@gayo73
gayo73 requested review from been12151 and yangyeeeun July 9, 2026 12:06
@gayo73 gayo73 self-assigned this Jul 9, 2026
@gayo73 gayo73 linked an issue Jul 9, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PGS] JadenCase 문자열 만들기 / level 2

1 participant