-
Notifications
You must be signed in to change notification settings - Fork 9
[week1] : 문자열 이어붙이기 구현 #11
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
Open
hyeminililo
wants to merge
1
commit into
SOPT-all:main
Choose a base branch
from
hyeminililo:week1/hyemin-namgung
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
|
|
||
| # 🧩 [Week1] 문자리스트르 | ||
|
|
||
| ## 📘 문제 정보 | ||
| - **문제 이름: 문자 리스트를 문자열로 변환하기** | ||
| - **출처:** 프로그래머스 | ||
| - **문제 번호 또는 링크:** | ||
| https://school.programmers.co.kr/learn/courses/30/lessons/181941 | ||
| --- | ||
|
|
||
| ## 📖 문제 설명 | ||
| 주어진 소문자 한 글자 배열을 순서대로 이어 붙여 하나의 문자열로 만드는 문제입니다. | ||
|
|
||
| --- | ||
|
|
||
| ## 🚀 접근 방식 | ||
| 1. 문제 유형 : 문자열 처리 | ||
| 2. 핵심 아이디어 : 배열의 모든 문자열을 하나로 이어붙인다. | ||
| 3. 알고리즘 흐름 : `joinToString`을 사용해 배열 원소를 구분자 없이 연결한다. | ||
|
|
||
| --- | ||
|
|
||
| ## 💡알게된 점 및 궁금한 점 | ||
| 이번 문제는 배열을 문자열로 변환해 출력하는 문제였는데, 이를 해결할 수 있는 joinToString() 이라는 함수가 코틀린 내에 있다는 것을 알게 되었다. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| class Solution { | ||
| fun solution(arr: Array<String>): String { | ||
|
|
||
| val answer = StringBuilder() | ||
| arr.forEach{ str -> | ||
| answer.append(str) | ||
| } | ||
| return answer.toString() | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문제에서는 Array< String>를 받고 있는데, List< Int>처럼 타입이 변경된다면 joinToString과 StringBuilder 방식 중 어떤 방식이 코드 변화가 더 적을까요??