Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {
public String solution(String my_string, String alp) {
String answer = "";
for (int i = 0; i < my_string.length(); i++) {
if (my_string.charAt(i) == alp.charAt(0)) {
char c = my_string.charAt(i);
char upper = (char)(c - 32);
answer += upper;
} else {
answer += my_string.charAt(i);
}
}
return answer;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# [level 0] 문자열 정수의 합 - 181849

[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/181849)

### 성능 요약

메모리: 71.7 MB, 시간: 0.05 ms

### 구분

코딩테스트 연습 > 코딩 기초 트레이닝

### 채점결과

정확성: 100.0<br/>합계: 100.0 / 100.0

### 제출 일자

2026년 01월 02일 14:43:39

### 문제 설명

<p>한 자리 정수로 이루어진 문자열 <code>num_str</code>이 주어질 때, 각 자리수의 합을 return하도록 solution 함수를 완성해주세요.</p>

<hr>

<h5>제한사항</h5>

<ul>
<li>3 ≤ <code>num_str</code> ≤ 100</li>
</ul>

<hr>

<h5>입출력 예</h5>
<table class="table">
<thead><tr>
<th>num_str</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>"123456789"</td>
<td>45</td>
</tr>
<tr>
<td>"1000000"</td>
<td>1</td>
</tr>
</tbody>
</table>
<hr>

<h5>입출력 예 설명</h5>

<p>입출력 예 #1</p>

<ul>
<li>문자열 안의 모든 숫자를 더하면 45가 됩니다.</li>
</ul>

<p>입출력 예 #2</p>

<ul>
<li>문자열 안의 모든 숫자를 더하면 1이 됩니다.</li>
</ul>


> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class Solution {
public int solution(String num_str) {
int answer = 0;
int num = 0;
for (int i = 0; i < num_str.length(); i++) {
num = num_str.charAt(i) - '0';
answer += num;
}
return answer;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# [level 0] 특정한 문자를 대문자로 바꾸기 - 181873

[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/181873)

### 성능 요약

메모리: 91.6 MB, 시간: 17.92 ms

### 구분

코딩테스트 연습 > 코딩 기초 트레이닝

### 채점결과

정확성: 100.0<br/>합계: 100.0 / 100.0

### 제출 일자

2026년 01월 01일 21:28:48

### 문제 설명

<p>영소문자로 이루어진 문자열 <code>my_string</code>과 영소문자 1글자로 이루어진 문자열 <code>alp</code>가 매개변수로 주어질 때, <code>my_string</code>에서 <code>alp</code>에 해당하는 모든 글자를 대문자로 바꾼 문자열을 return 하는 solution 함수를 작성해 주세요.</p>

<hr>

<h5>제한사항</h5>

<ul>
<li>1 ≤ <code>my_string</code>의 길이 ≤ 1,000</li>
</ul>

<hr>

<h5>입출력 예</h5>
<table class="table">
<thead><tr>
<th>my_string</th>
<th>alp</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>"programmers"</td>
<td>"p"</td>
<td>"Programmers"</td>
</tr>
<tr>
<td>"lowercase"</td>
<td>"x"</td>
<td>"lowercase"</td>
</tr>
</tbody>
</table>
<hr>

<h5>입출력 예 설명</h5>

<p>입출력 예 #1</p>

<ul>
<li>예제 1번의 <code>my_string</code>은 "programmers"이고 <code>alp</code>가 "p"이므로 <code>my_string</code>에 모든 p를 대문자인 P로 바꾼 문자열 "Programmers"를 return 합니다.</li>
</ul>

<p>입출력 예 #2</p>

<ul>
<li>예제 2번의 <code>alp</code>는 "x"이고 <code>my_string</code>에 x는 없습니다. 따라서 "lowercase"를 return 합니다.</li>
</ul>


> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {
public String solution(String my_string, String alp) {
String answer = "";
for (int i = 0; i < my_string.length(); i++) {
if (my_string.charAt(i) == alp.charAt(0)) {
char c = my_string.charAt(i);
char upper = (char)(c - 32);
answer += upper;
} else {
answer += my_string.charAt(i);
}
}
return answer;
}
}