Skip to content

Commit 7154c2f

Browse files
committed
[level 0] Title: 편지, Time: 0.03 ms, Memory: 83.7 MB -BaekjoonHub
1 parent 554dc34 commit 7154c2f

2 files changed

Lines changed: 78 additions & 0 deletions

File tree

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# [level 0] 편지 - 120898
2+
3+
[문제 링크](https://school.programmers.co.kr/learn/courses/30/lessons/120898)
4+
5+
### 성능 요약
6+
7+
메모리: 83.7 MB, 시간: 0.03 ms
8+
9+
### 구분
10+
11+
코딩테스트 연습 > 코딩테스트 입문
12+
13+
### 채점결과
14+
15+
정확성: 100.0<br/>합계: 100.0 / 100.0
16+
17+
### 제출 일자
18+
19+
2024년 12월 26일 22:04:49
20+
21+
### 문제 설명
22+
23+
<p>머쓱이는 할머니께 생신 축하 편지를 쓰려고 합니다. 할머니가 보시기 편하도록 글자 한 자 한 자를 가로 2cm 크기로 적으려고 하며, 편지를 가로로만 적을 때, 축하 문구 <code>message</code>를 적기 위해 필요한 편지지의 최소 가로길이를 return 하도록 solution 함수를 완성해주세요.</p>
24+
25+
<hr>
26+
27+
<h5>제한사항</h5>
28+
29+
<ul>
30+
<li>공백도 하나의 문자로 취급합니다.</li>
31+
<li>1 ≤ message의 길이 ≤ 50</li>
32+
<li>편지지의 여백은 생각하지 않습니다.</li>
33+
<li><code>message</code>는 영문 알파벳 대소문자, ‘!’, ‘~’ 또는 공백으로만 이루어져 있습니다.</li>
34+
</ul>
35+
36+
<hr>
37+
38+
<h5>입출력 예</h5>
39+
<table class="table">
40+
<thead><tr>
41+
<th>message</th>
42+
<th>result</th>
43+
</tr>
44+
</thead>
45+
<tbody><tr>
46+
<td>"happy birthday!"</td>
47+
<td>30</td>
48+
</tr>
49+
<tr>
50+
<td>"I love you~"</td>
51+
<td>22</td>
52+
</tr>
53+
</tbody>
54+
</table>
55+
<hr>
56+
57+
<h5>입출력 예 설명</h5>
58+
59+
<p>입출력 예 #1</p>
60+
61+
<ul>
62+
<li><code>message</code>의 글자 수가 15개로 최소 가로 30cm의 편지지가 필요합니다.</li>
63+
</ul>
64+
65+
<p>입출력 예 #2</p>
66+
67+
<ul>
68+
<li><code>message</code>의 글자 수가 11개로 최소 가로 22cm의 편지지가 필요합니다.</li>
69+
</ul>
70+
71+
72+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class Solution {
2+
public int solution(String message) {
3+
int answer = 0;
4+
return message.length() * 2;
5+
}
6+
}

0 commit comments

Comments
 (0)