You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 60f0991
Browse filesBrowse the repository at this point in the historyBrowse files
<p>자연수 <code>n</code>이 매개변수로 주어집니다. <code>n</code>을 <code>x</code>로 나눈 나머지가 1이 되도록 하는 가장 작은 자연수 <code>x</code>를 return 하도록 solution 함수를 완성해주세요. 답이 항상 존재함은 증명될 수 있습니다.</p>
24
+
25
+
<hr>
26
+
27
+
<h5>제한사항</h5>
28
+
29
+
<ul>
30
+
<li>3 ≤ <code>n</code> ≤ 1,000,000</li>
31
+
</ul>
32
+
33
+
<hr>
34
+
35
+
<h5>입출력 예</h5>
36
+
<tableclass="table">
37
+
<thead><tr>
38
+
<th>n</th>
39
+
<th>result</th>
40
+
</tr>
41
+
</thead>
42
+
<tbody><tr>
43
+
<td>10</td>
44
+
<td>3</td>
45
+
</tr>
46
+
<tr>
47
+
<td>12</td>
48
+
<td>11</td>
49
+
</tr>
50
+
</tbody>
51
+
</table>
52
+
<hr>
53
+
54
+
<h5>입출력 예 설명</h5>
55
+
56
+
<p><strong>입출력 예 #1</strong></p>
57
+
58
+
<ul>
59
+
<li>10을 3으로 나눈 나머지가 1이고, 3보다 작은 자연수 중에서 문제의 조건을 만족하는 수가 없으므로, 3을 return 해야 합니다.</li>
60
+
</ul>
61
+
62
+
<p><strong>입출력 예 #2</strong></p>
63
+
64
+
<ul>
65
+
<li>12를 11로 나눈 나머지가 1이고, 11보다 작은 자연수 중에서 문제의 조건을 만족하는 수가 없으므로, 11을 return 해야 합니다.</li>
66
+
</ul>
67
+
68
+
69
+
> 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/challenges
0 commit comments