<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>leeda06</title>
        <link>https://velog.io/</link>
        <description>웹솔루션과</description>
        <lastBuildDate>Thu, 21 Mar 2024 10:59:05 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>leeda06</title>
            <url>https://velog.velcdn.com/images/bnm_08/profile/a5aa3ff5-4880-4035-8bb6-a1765338b700/image.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. leeda06. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/bnm_08" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[git bash 코드 수업]]></title>
            <link>https://velog.io/@bnm_08/git-bash-%EC%BD%94%EB%93%9C-%EC%88%98%EC%97%85</link>
            <guid>https://velog.io/@bnm_08/git-bash-%EC%BD%94%EB%93%9C-%EC%88%98%EC%97%85</guid>
            <pubDate>Thu, 21 Mar 2024 10:59:05 GMT</pubDate>
            <description><![CDATA[<h3 id="touch">touch</h3>
<ul>
<li>touch는 파일이 없으면 파일을 생성한다</li>
<li>만약 이미 파일이있으면 수정시간을 바꾼다<h4 id="왜-쓸까">왜 쓸까?</h4>
</li>
<li>마지막으로 수정된 때를 알수 있다 </li>
</ul>
<h3 id="nano">nano</h3>
<ul>
<li>편집을 할 수 있다<h4 id="nano-bash_history">nano .bash_history</h4>
</li>
<li>명령어를 확인할수 있다</li>
</ul>
<h3 id="pwd">pwd</h3>
<ul>
<li>인터페이스에서 현재 작업 중인 디렉터리의 이름을 출력할수 있다</li>
</ul>
<h3 id="explor">explor</h3>
<ul>
<li>탐색</li>
</ul>
<h3 id="vim">vim</h3>
<h4 id="i">i</h4>
<ul>
<li>작성하기<h4 id="esc--yy-숫자-p">esc + yy (숫자) p</h4>
</li>
<li>숫자 만큼 작성한것 복사 붙여넣기</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 정수 찾기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EC%A0%95%EC%88%98-%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EC%A0%95%EC%88%98-%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Thu, 14 Dec 2023 14:49:53 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수 리스트 <code>num_list</code>와 찾으려는 정수 <code>n</code>이 주어질 때, <code>num_list</code> 안에 <code>n</code>이 있으면 1을, 없으면 0을 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>3 ≤ <code>num_list</code>의 길이 ≤ 100</li>
<li>1 ≤ <code>num_list</code>의 원소 ≤ 100</li>
<li>1 ≤ <code>n</code> ≤ 100</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>num_list</th>
<th>n</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[1, 2, 3, 4, 5]</td>
<td>3</td>
<td>1</td>
</tr>
<tr>
<td>[15, 98, 23, 2, 15]</td>
<td>20</td>
<td>0</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>[1, 2, 3, 4, 5] 안에 3이 있으므로 1을 반환합니다.</p>
<p><strong>예시 #2</strong></p>
<p>[15, 98, 23, 2, 15] 안에 20이 없으므로 0을 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(int[] num_list, int n) {
        int answer = 0;
        for(int i = 0; i &lt; num_list.length; i++){
            if(num_list[i] == n){
                answer = 1;
                break;
            }
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 소문자로 바꾸기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EC%86%8C%EB%AC%B8%EC%9E%90%EB%A1%9C-%EB%B0%94%EA%BE%B8%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EC%86%8C%EB%AC%B8%EC%9E%90%EB%A1%9C-%EB%B0%94%EA%BE%B8%EA%B8%B0</guid>
            <pubDate>Thu, 14 Dec 2023 14:48:56 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>알파벳으로 이루어진 문자열 <code>myString</code>이 주어집니다. 모든 알파벳을 소문자로 변환하여 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ <code>myString</code>의 길이 ≤ 100,000</li>
<li><code>myString</code>은 알파벳으로 이루어진 문자열입니다.</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>myString</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;aBcDeFg&quot;</td>
<td>&quot;abcdefg&quot;</td>
</tr>
<tr>
<td>&quot;aaa&quot;</td>
<td>&quot;aaa&quot;</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>&quot;aBcDeFg&quot;를 모두 소문자로 변환하면 &quot;abcdefg&quot;이 됩니다.</p>
<p><strong>예시 #2</strong></p>
<p>&quot;aaa&quot;는 이미 모두 소문자이므로 변환하지 않고 그대로 &quot;aaa&quot;를 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public String solution(String myString) {
        String answer = myString.toLowerCase();
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 길이에 따른 연산]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EA%B8%B8%EC%9D%B4%EC%97%90-%EB%94%B0%EB%A5%B8-%EC%97%B0%EC%82%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EA%B8%B8%EC%9D%B4%EC%97%90-%EB%94%B0%EB%A5%B8-%EC%97%B0%EC%82%B0</guid>
            <pubDate>Thu, 14 Dec 2023 14:47:43 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수가 담긴 리스트 <code>num_list</code>가 주어질 때, 리스트의 길이가 11 이상이면 리스트에 있는 모든 원소의 합을, 10 이하이면 모든 원소의 곱을 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>2 ≤ <code>num_list</code>의 길이 ≤ 20</li>
<li>1 ≤ <code>num_list</code>의 원소 ≤ 9</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>num_list</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[3, 4, 5, 2, 5, 4, 6, 7, 3, 7, 2, 2, 1]</td>
<td>51</td>
</tr>
<tr>
<td>[2, 3, 4, 5]</td>
<td>120</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>리스트의 길이가 13이므로 모든 원소의 합인 51을 반환합니다.</p>
<p><strong>예시 #2</strong></p>
<p>리스트의 길이가 4이므로 모든 원소의 곱인 120을 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(int[] num_list) {
        int answer = 0;
        int sum = 0;
        int mult = 1;

        for (int i = 0; i &lt; num_list.length; i++) {
            sum += num_list[i];
        }

        for (int i = 0; i &lt; num_list.length; i++) {
            mult *= num_list[i];
        }

        if(num_list.length &gt; 10){
            answer = sum;
        }else{
            answer = mult;
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 뒤에서 5등 위로]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%92%A4%EC%97%90%EC%84%9C-5%EB%93%B1-%EC%9C%84%EB%A1%9C</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%92%A4%EC%97%90%EC%84%9C-5%EB%93%B1-%EC%9C%84%EB%A1%9C</guid>
            <pubDate>Thu, 14 Dec 2023 14:46:32 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수로 이루어진 리스트 <code>num_list</code>가 주어집니다. <code>num_list</code>에서 가장 작은 5개의 수를 제외한 수들을 오름차순으로 담은 리스트를 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>6 ≤ <code>num_list</code>의 길이 ≤ 30</li>
<li>1 ≤ <code>num_list</code>의 원소 ≤ 100</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>num_list</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[12, 4, 15, 46, 38, 1, 14, 56, 32, 10]</td>
<td>[15, 32, 38, 46, 56]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>[12, 4, 15, 46, 38, 1, 14, 56, 32, 10]를 정렬하면 [1, 4, 10, 12, 14, 15, 32, 38, 46, 56]이 되고, 앞에서부터 6번째 이후의 수들을 고르면 [15, 32, 38, 46, 56]가 됩니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">import java.util.Arrays;

class Solution {
    public int[] solution(int[] num_list) {
        Arrays.sort(num_list);
        int[] answer = new int[num_list.length-5];
        for(int i = 0; i &lt; answer.length; i++){
            answer[i] = num_list[i + 5];
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 카운트 업]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EC%B9%B4%EC%9A%B4%ED%8A%B8-%EC%97%85</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EC%B9%B4%EC%9A%B4%ED%8A%B8-%EC%97%85</guid>
            <pubDate>Tue, 12 Dec 2023 16:01:36 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수 <code>start_num</code>와 <code>end_num</code>가 주어질 때, <code>start_num</code>부터 <code>end_num</code>까지의 숫자를 차례로 담은 리스트를 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>0 ≤ <code>start_num</code> ≤ <code>end_num</code> ≤ 50</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>start_num</th>
<th>end_num</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>3</td>
<td>10</td>
<td>[3, 4, 5, 6, 7, 8, 9, 10]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>3부터 10까지의 숫자들을 담은 리스트 [3, 4, 5, 6, 7, 8, 9, 10]를 반환합니다.    ---</p>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int[] solution(int start_num, int end_num) {
        int[] answer = new int[end_num - start_num + 1];

        for(int i = 0; i &lt; answer.length; i++){
            answer[i] = start_num + i ; 
        }

        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p><code>answer []</code>의 배열 방 크기 : 끝지점부터 첫지점까지의 개수를 구하기 위해 <code>end_num - start_num + 1</code>를 사용하여 배열 방의 크기르 지정함.</p>
</li>
<li><p><code>start_num + i</code> : 1씩 증가하도록 만든 코드임.</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 조건에 맞게 수열 변환하기 1]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EC%A1%B0%EA%B1%B4%EC%97%90-%EB%A7%9E%EA%B2%8C-%EC%88%98%EC%97%B4-%EB%B3%80%ED%99%98%ED%95%98%EA%B8%B0-1</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EC%A1%B0%EA%B1%B4%EC%97%90-%EB%A7%9E%EA%B2%8C-%EC%88%98%EC%97%B4-%EB%B3%80%ED%99%98%ED%95%98%EA%B8%B0-1</guid>
            <pubDate>Tue, 12 Dec 2023 15:56:08 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수 배열 <code>arr</code>가 주어집니다. <code>arr</code>의 각 원소에 대해 값이 50보다 크거나 같은 짝수라면 2로 나누고, 50보다 작은 홀수라면 2를 곱합니다. 그 결과인 정수 배열을 반환하는 <code>solution</code> 함수를 완성해 주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ <code>arr</code>의 길이 ≤ 1,000,000</li>
<li>1 ≤ <code>arr</code>의 원소의 값 ≤ 100</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>arr</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[1, 2, 3, 100, 99, 98]</td>
<td>[2, 2, 6, 50, 99, 49]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>1, 3은 50 미만의 홀수이므로 2를 곱하고, 100, 98은 50 이상의 짝수이므로 2로 나눕니다. 나머지 값들은 변경 조건에 해당하지 않으므로 바꾸지 않습니다. 따라서 [2, 2, 6, 50, 99, 49]를 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int[] solution(int[] arr) {
        int[] answer = new int[arr.length];

        for (int i = 0; i &lt; arr.length; i++) {
            if (arr[i] &gt;= 50 &amp;&amp; arr[i] % 2 == 0) {
                answer[i] = arr[i] / 2;
            } else if (arr[i] &lt; 50 &amp;&amp; arr[i] % 2 != 0) {
                answer[i] = arr[i] * 2;
            } else {
                answer[i] = arr[i];
            }
        }

        return answer;
    }
}
</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><code>if</code>문 조건 : 문제에 맞도록 각각 작성한 조건문임. </li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] n 번째 원소까지]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-n-%EB%B2%88%EC%A7%B8-%EC%9B%90%EC%86%8C%EA%B9%8C%EC%A7%80</link>
            <guid>https://velog.io/@bnm_08/Lv.0-n-%EB%B2%88%EC%A7%B8-%EC%9B%90%EC%86%8C%EA%B9%8C%EC%A7%80</guid>
            <pubDate>Tue, 12 Dec 2023 15:47:22 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수 리스트 <code>num_list</code>와 정수 <code>n</code>이 주어질 때, <code>num_list</code>의 첫 번째 원소부터 <code>n</code> 번째 원소까지의 모든 원소를 담은 리스트를 반환하도록 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>2 ≤ <code>num_list</code>의 길이 ≤ 30</li>
<li>1 ≤ <code>num_list</code>의 원소 ≤ 9</li>
<li>1 ≤ <code>n</code> ≤ <code>num_list</code>의 길이</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>num_list</th>
<th>n</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[2, 1, 6]</td>
<td>1</td>
<td>[2]</td>
</tr>
<tr>
<td>[5, 2, 1, 7, 5]</td>
<td>3</td>
<td>[5, 2, 1]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>[2, 1, 6]의 첫 번째 원소부터 첫 번째 원소까지의 모든 원소는 [2]입니다.</p>
<p><strong>예시 #2</strong></p>
<p>[5, 2, 1, 7, 5]의 첫 번째 원소부터 세 번째 원소까지의 모든 원소는 [5, 2, 1]입니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int[] solution(int[] num_list, int n) {
        int[] answer = new int[n];

        for(int i = 0; i &lt; n; i ++){
            answer[i] = num_list[i];
        }

        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><code>answer</code>의 배열 방 크기: 변수 <code>n</code>은 개수를 가리키는 변수이므로 이것을 배열 방의 크기로 지정함.</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] n보다 커질 때까지 더하기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-n%EB%B3%B4%EB%8B%A4-%EC%BB%A4%EC%A7%88-%EB%95%8C%EA%B9%8C%EC%A7%80-%EB%8D%94%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-n%EB%B3%B4%EB%8B%A4-%EC%BB%A4%EC%A7%88-%EB%95%8C%EA%B9%8C%EC%A7%80-%EB%8D%94%ED%95%98%EA%B8%B0</guid>
            <pubDate>Tue, 12 Dec 2023 15:42:44 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>정수 배열 <code>numbers</code>와 정수 <code>n</code>이 매개변수로 주어집니다. <code>numbers</code>의 원소를 앞에서부터 하나씩 더하다가 그 합이 <code>n</code>보다 커지는 순간 이때까지 더했던 원소들의 합을 반환하는 <code>solution</code> 함수를 작성해 주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ <code>numbers</code>의 길이 ≤ 100</li>
<li>1 ≤ <code>numbers</code>의 원소 ≤ 100</li>
<li>0 ≤ <code>n</code> &lt; <code>numbers</code>의 모든 원소의 합</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>numbers</th>
<th>n</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[34, 5, 71, 29, 100, 34]</td>
<td>123</td>
<td>139</td>
</tr>
<tr>
<td>[58, 44, 27, 10, 100]</td>
<td>139</td>
<td>239</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>예제 1번의 <code>numbers</code>를 문제 설명대로 더해가는 과정을 나타내면 다음의 표와 같습니다.</p>
<table>
<thead>
<tr>
<th>i</th>
<th>numbers[i]</th>
<th>sum</th>
</tr>
</thead>
<tbody><tr>
<td>0</td>
<td></td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>34</td>
<td>34</td>
</tr>
<tr>
<td>1</td>
<td>5</td>
<td>39</td>
</tr>
<tr>
<td>2</td>
<td>71</td>
<td>110</td>
</tr>
<tr>
<td>3</td>
<td>29</td>
<td>139</td>
</tr>
</tbody></table>
<p>29를 더한 뒤에 <code>sum</code> 값은 139이고 <code>n</code> 값인 123보다 크므로 139를 반환합니다.</p>
<p><strong>예시 #2</strong></p>
<p>예제 2번의 <code>numbers</code>의 마지막 원소 전까지의 원소를 <code>sum</code>에 더하면 139입니다. 139는 <code>n</code> 값인 139보다 크지 않고 마지막 원소인 100을 더하면 239보다 커지므로 239를 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(int[] numbers, int n) {
        int answer = 0;
        for(int i = 0; i &lt; numbers.length; i++){
            answer += numbers[i];
            if(answer &gt; n){
                break;
            }
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><code>if문 조건</code> : <code>n</code>보다 커질때 만 이기에 <code>answer &gt; n</code>를 사용한 조건문임</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 5명씩]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-5%EB%AA%85%EC%94%A9</link>
            <guid>https://velog.io/@bnm_08/Lv.0-5%EB%AA%85%EC%94%A9</guid>
            <pubDate>Tue, 12 Dec 2023 14:43:23 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>최대 5명씩 탑승 가능한 놀이기구를 타기 위해 줄을 서있는 사람들의 이름이 담긴 문자열 리스트 <code>names</code>가 주어질 때, 앞에서부터 5명씩 묶은 그룹의 가장 앞에 서있는 사람들의 이름을 담은 리스트를 반환하는 <code>solution</code> 함수를 완성해주세요. 마지막 그룹이 5명이 되지 않더라도 가장 앞에 있는 사람의 이름을 포함합니다.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>5 ≤ <code>names</code>의 길이 ≤ 30</li>
<li>1 ≤ <code>names</code>의 원소의 길이 ≤ 10</li>
<li><code>names</code>의 원소는 영어 알파벳 소문자로만 이루어져 있습니다.</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>names</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[&quot;nami&quot;, &quot;ahri&quot;, &quot;jayce&quot;, &quot;garen&quot;, &quot;ivern&quot;, &quot;vex&quot;, &quot;jinx&quot;]</td>
<td>[&quot;nami&quot;, &quot;vex&quot;]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>앞에서부터 5명씩 두 그룹으로 묶을 수 있습니다. [&quot;nami&quot;, &quot;ahri&quot;, &quot;jayce&quot;, &quot;garen&quot;, &quot;ivern&quot;], [&quot;vex&quot;, &quot;jinx&quot;] 이 두 그룹에서 가장 앞에 서있는 사람들의 이름을 담은 리스트인 [&quot;nami&quot;, &quot;vex&quot;]를 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">import java.util.Arrays;

class Solution {
    public String[] solution(String[] names) {
        int groupCount = (int) Math.ceil((double) names.length / 5);
        String[] answer = new String[groupCount];

        int count = 0;

        for (int i = 0; i &lt; names.length; i += 5) {
            answer[count] = String.join(&quot; &quot;, names[i]);
            count++;
        }

        return answer;
    }
}
</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 마지막 두 원소]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%A7%88%EC%A7%80%EB%A7%89-%EB%91%90-%EC%9B%90%EC%86%8C</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%A7%88%EC%A7%80%EB%A7%89-%EB%91%90-%EC%9B%90%EC%86%8C</guid>
            <pubDate>Tue, 12 Dec 2023 14:41:01 GMT</pubDate>
            <description><![CDATA[<h1 id="문제-설명">문제 설명</h1>
<p>정수 리스트 <code>num_list</code>가 주어질 때, 마지막 원소가 그 전 원소보다 크면 마지막 원소에서 그전 원소를 뺀 값을, 마지막 원소가 그전 원소보다 크지 않다면 마지막 원소를 두 배한 값을 추가하여 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>2 ≤ <code>num_list</code>의 길이 ≤ 10</li>
<li>1 ≤ <code>num_list</code>의 원소 ≤ 9</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>num_list</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[2, 1, 6]</td>
<td>[2, 1, 6, 5]</td>
</tr>
<tr>
<td>[5, 2, 1, 7, 5]</td>
<td>[5, 2, 1, 7, 5, 10]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>마지막 원소인 6이 그 전 원소인 1보다 크기 때문에 6 - 1인 5를 추가해 반환합니다.</p>
<p><strong>예시 #2</strong></p>
<p>마지막 원소인 5가 그전 원소인 7보다 크지 않기 때문에 5의 두 배인 10을 추가해 반환합니다.---</p>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int[] solution(int[] num_list) {
        int num = num_list.length;

        int[] answer = new int[num + 1];

        for (int i = 0; i &lt; num + 1; i++) {
            if (i == num ) {
                if (num_list[num - 1] &gt; num_list[num - 2]) {
                    answer[i] = num_list[num - 1] - num_list[num - 2];
                } else {
                    answer[i] = num_list[num - 1] * 2;
                }
            } else {
                answer[i] = num_list[i];
            }
        }

        return answer;
    }
}
</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 뒤에서 5등까지]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%92%A4%EC%97%90%EC%84%9C-5%EB%93%B1%EA%B9%8C%EC%A7%80</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%92%A4%EC%97%90%EC%84%9C-5%EB%93%B1%EA%B9%8C%EC%A7%80</guid>
            <pubDate>Tue, 12 Dec 2023 14:40:02 GMT</pubDate>
            <description><![CDATA[<h1 id="문제-설명">문제 설명</h1>
<p>정수로 이루어진 리스트 <code>num_list</code>가 주어집니다. <code>num_list</code>에서 가장 작은 5개의 수를 오름차순으로 담은 리스트를 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>6 ≤ <code>num_list</code>의 길이 ≤ 30</li>
<li>1 ≤ <code>num_list</code>의 원소 ≤ 100</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>num_list</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>[12, 4, 15, 46, 38, 1, 14]</td>
<td>[1, 4, 12, 14, 15]</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>[12, 4, 15, 46, 38, 1, 14]를 정렬하면 [1, 4, 12, 14, 15, 38, 46]이 되고, 앞에서부터 5개를 고르면 [1, 4, 12, 14, 15]가 됩니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">import java.util.Arrays;

class Solution {
    public int[] solution(int[] num_list) {
        Arrays.sort(num_list);
        int[] answer = new int[5];
        for(int i = 0; i &lt; answer.length; i++){
            answer[i] = num_list[i];
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 문자열 바꿔서 찾기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%B0%94%EA%BF%94%EC%84%9C-%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%B0%94%EA%BF%94%EC%84%9C-%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Tue, 12 Dec 2023 14:38:41 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>문자 &quot;A&quot;와 &quot;B&quot;로 이루어진 문자열 <code>myString</code>과 <code>pat</code>가 주어집니다. <code>myString</code>의 &quot;A&quot;를 &quot;B&quot;로, &quot;B&quot;를 &quot;A&quot;로 바꾼 문자열의 연속하는 부분 문자열 중 <code>pat</code>이 있으면 1을, 아니면 0을 반환하는 <code>solution</code> 함수를 완성하세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ myString의 길이 ≤ 100</li>
<li>1 ≤ pat의 길이 ≤ 10</li>
<li><code>myString</code>과 <code>pat</code>는 문자 &quot;A&quot;와 &quot;B&quot;로만 이루어진 문자열입니다.</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>myString</th>
<th>pat</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;ABBAA&quot;</td>
<td>&quot;AABB&quot;</td>
<td>1</td>
</tr>
<tr>
<td>&quot;ABAB&quot;</td>
<td>&quot;ABAB&quot;</td>
<td>0</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>&quot;ABBAA&quot;에서 &quot;A&quot;와 &quot;B&quot;를 서로 바꾸면 &quot;BAABB&quot;입니다. 여기에는 부분문자열 &quot;AABB&quot;가 있기 때문에 1을 반환합니다.</p>
<p><strong>예시 #2</strong></p>
<p>&quot;ABAB&quot;에서 &quot;A&quot;와 &quot;B&quot;를 서로 바꾸면 &quot;BABA&quot;입니다. 여기에는 부분문자열 &quot;BABA&quot;가 없기 때문에 0을 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(String myString, String pat) {
        int answer = 0;
        char [] list = myString.toCharArray();

        for(int i = 0; i &lt; list.length; i++){
            if(list[i] == &#39;A&#39;){
                list[i] = &#39;B&#39;;
            }else if(list[i] == &#39;B&#39;){
                list[i] = &#39;A&#39;;                
            }
        }

        myString = String.valueOf(list);

        if(myString.contains(pat)){
            answer = 1;
        }

        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p>`` : </p>
</li>
<li><p>`` : </p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 접미사인지 확인하기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EC%A0%91%EB%AF%B8%EC%82%AC%EC%9D%B8%EC%A7%80-%ED%99%95%EC%9D%B8%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EC%A0%91%EB%AF%B8%EC%82%AC%EC%9D%B8%EC%A7%80-%ED%99%95%EC%9D%B8%ED%95%98%EA%B8%B0</guid>
            <pubDate>Mon, 11 Dec 2023 03:19:50 GMT</pubDate>
            <description><![CDATA[<h1 id="문제-설명">문제 설명</h1>
<p>어떤 문자열에 대해서 접미사는 특정 인덱스부터 시작하는 문자열을 의미합니다. 예를 들어, &quot;banana&quot;의 모든 접미사는 &quot;banana&quot;, &quot;anana&quot;, &quot;nana&quot;, &quot;ana&quot;, &quot;na&quot;, &quot;a&quot;입니다. 문자열 <code>my_string</code>과 <code>is_suffix</code>가 주어질 때, 만약 <code>is_suffix</code>가 <code>my_string</code>의 접미사라면 1을, 아니면 0을 반환하는 <code>solution</code> 함수를 작성해 주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ my_string의 길이 ≤ 100</li>
<li>1 ≤ is_suffix의 길이 ≤ 100</li>
<li><code>my_string</code>과 <code>is_suffix</code>는 영소문자로만 이루어져 있습니다.</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>my_string</th>
<th>is_suffix</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;banana&quot;</td>
<td>&quot;ana&quot;</td>
<td>1</td>
</tr>
<tr>
<td>&quot;banana&quot;</td>
<td>&quot;nan&quot;</td>
<td>0</td>
</tr>
<tr>
<td>&quot;banana&quot;</td>
<td>&quot;wxyz&quot;</td>
<td>0</td>
</tr>
<tr>
<td>&quot;banana&quot;</td>
<td>&quot;abanana&quot;</td>
<td>0</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>is_suffix가 my_string의 접미사이기 때문에 1을 반환합니다.</p>
<p><strong>예시 #2</strong></p>
<p>is_suffix가 my_string의 접미사가 아니기 때문에 0을 반환합니다.</p>
<p><strong>예시 #3</strong></p>
<p>is_suffix가 my_string의 접미사가 아니기 때문에 0을 반환합니다.</p>
<p><strong>예시 #4</strong></p>
<p>is_suffix가 my_string의 접미사가 아니기 때문에 0을 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(String my_string, String is_suffix) {
        int answer = 0;

        for(int i = 0; i &lt; my_string.length(); i++){
           if (is_suffix.equals(my_string.substring(i))){
                answer = 1;
               break;
           }
        }

        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p><code>.equals()</code> : <code>String</code>타입이 같은지 다른지 비교함.</p>
</li>
<li><p><code>.substring()</code> : <code>String</code>타입의 변수의 n값부터 마지막까지를 가져오는 내장 함수이지만 원래의 변수의 값은 변하지 않음.</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 홀짝 구분하기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%ED%99%80%EC%A7%9D-%EA%B5%AC%EB%B6%84%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%ED%99%80%EC%A7%9D-%EA%B5%AC%EB%B6%84%ED%95%98%EA%B8%B0</guid>
            <pubDate>Mon, 11 Dec 2023 03:15:44 GMT</pubDate>
            <description><![CDATA[<h1 id="문제-설명">문제 설명</h1>
<p>자연수 <code>n</code>이 입력으로 주어졌을 때, 만약 <code>n</code>이 짝수이면 &quot;n is even&quot;을, 홀수이면 &quot;n is odd&quot;를 출력하는 코드를 작성해 보세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ n ≤ 1,000</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<h4 id="입력-1">입력 #1</h4>
<pre><code>100</code></pre><h4 id="출력-1">출력 #1</h4>
<pre><code>100 is even</code></pre><h4 id="입력-2">입력 #2</h4>
<pre><code>1</code></pre><h4 id="출력-2">출력 #2</h4>
<pre><code>1 is odd</code></pre><p>※ 2023년 05월 15일 지문이 수정되었습니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        String answer = &quot;&quot;;

        if(n % 2 == 0){
            answer = &quot; is even&quot;;
        }else{
            answer = &quot; is odd&quot;;
        }

        System.out.print(n + answer);
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p><code>Scanner sc = new Scanner(System.in)</code> : 입력을 받기 위한 클래스임.</p>
</li>
<li><p><code>if</code>문 조건 : 입력 받은 수(<code>n</code>)의 값이 짝수인지 확인하는 조건문임.</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 문자열을 정수로 변환하기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%AC%B8%EC%9E%90%EC%97%B4%EC%9D%84-%EC%A0%95%EC%88%98%EB%A1%9C-%EB%B3%80%ED%99%98%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%AC%B8%EC%9E%90%EC%97%B4%EC%9D%84-%EC%A0%95%EC%88%98%EB%A1%9C-%EB%B3%80%ED%99%98%ED%95%98%EA%B8%B0</guid>
            <pubDate>Mon, 11 Dec 2023 03:08:27 GMT</pubDate>
            <description><![CDATA[<h1 id="문제-설명">문제 설명</h1>
<p>숫자로만 이루어진 문자열 <code>n_str</code>이 주어질 때, 이를 정수로 변환하여 반환하는 <code>solution</code> 함수를 완성해주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ len(n_str) ≤ 5</li>
<li><code>n_str</code>은 0부터 9까지의 정수 문자로만 이루어져 있습니다.</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>n_str</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;10&quot;</td>
<td>10</td>
</tr>
<tr>
<td>&quot;8542&quot;</td>
<td>8542</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong></p>
<p>&quot;10&quot;을 정수로 변환하면 10이 됩니다.</p>
<p><strong>예시 #2</strong></p>
<p>&quot;8542&quot;를 정수로 변환하면 8542가 됩니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(String n_str) {
        int answer = 0;

        answer = Integer.parseInt(n_str);

        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><code>Integer.parseInt()</code> : <code>String</code>타입을 <code>int</code>타입으로 변환하는 내장 함수임.</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 더 크게 합치기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%8D%94-%ED%81%AC%EA%B2%8C-%ED%95%A9%EC%B9%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%8D%94-%ED%81%AC%EA%B2%8C-%ED%95%A9%EC%B9%98%EA%B8%B0</guid>
            <pubDate>Mon, 11 Dec 2023 03:05:50 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>연산 ⊕는 두 정수에 대한 연산으로 두 정수를 붙여서 쓴 값을 반환합니다. 예를 들면 다음과 같습니다.</p>
<p>12 ⊕ 3 = 123
3 ⊕ 12 = 312
양의 정수 a와 b가 주어졌을 때, a ⊕ b와 b ⊕ a 중 더 큰 값을 return 하는 solution 함수를 완성해 주세요.</p>
<p>단, a ⊕ b와 b ⊕ a가 같다면 a ⊕ b를 return 합니다.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>1 ≤ a, b &lt; 10,000</li>
</ul>
<h3 id="입출력-예시">입출력 예시</h3>
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>결과</th>
</tr>
</thead>
<tbody><tr>
<td>9</td>
<td>91</td>
<td>991</td>
</tr>
<tr>
<td>89</td>
<td>8</td>
<td>898</td>
</tr>
</tbody></table>
<h3 id="입출력-예시-설명">입출력 예시 설명</h3>
<p><strong>예시 #1</strong>
a ⊕ b = 991 이고, b ⊕ a = 919 입니다. 둘 중 더 큰 값은 991 이므로 991을 반환합니다.</p>
<p><strong>예시 #2</strong>
a ⊕ b = 898 이고, b ⊕ a = 889 입니다. 둘 중 더 큰 값은 898 이므로 898을 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(int a, int b) {
        int answer = 0;

        int numAB = Integer.parseInt(Integer.toString(a) + Integer.toString(b));
        int numBA = Integer.parseInt(Integer.toString(b) + Integer.toString(a));

        if(numAB &gt;= numBA){
            answer = numAB;
        }else{
            answer = numBA;
        }

        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p><code>numAB</code> or <code>numBA</code>의 초기값 : <code>String</code>타입처럼 <code>int</code>타입을 더해야하기에 타입을 변환하여 합을 구하여 사용하기 위함임.</p>
</li>
<li><p><code>Integer.parseInt()</code> : <code>String</code> 타입을 <code>int</code> 타입으로 변환하는 내장함수 임.</p>
</li>
<li><p><code>Integer.toString()</code> : <code>int</code> 타입을 <code>String</code> 타입으로 변환하는 내장함수 임.</p>
</li>
<li><p><code>if</code>문 조건문 : <code>a + b</code>가 더 클때에는 <code>a + b</code>의 값을 반환하기에 <code>numAB &gt;= numBA</code>으로 조건문을 작성함.</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] n의 배수]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-n%EC%9D%98-%EB%B0%B0%EC%88%98</link>
            <guid>https://velog.io/@bnm_08/Lv.0-n%EC%9D%98-%EB%B0%B0%EC%88%98</guid>
            <pubDate>Sun, 10 Dec 2023 14:33:29 GMT</pubDate>
            <description><![CDATA[<h3 id="문제-설명">문제 설명</h3>
<p>정수 <code>num</code>과 <code>n</code>이 매개 변수로 주어질 때, <code>num</code>이 <code>n</code>의 배수이면 1을, <code>n</code>의 배수가 아니라면 0을 반환하도록 <code>solution</code> 함수를 완성해주세요.</p>
<h4 id="제한사항">제한사항</h4>
<ul>
<li>2 ≤ <code>num</code> ≤ 100</li>
<li>2 ≤ <code>n</code> ≤ 9</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>num</th>
<th>n</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>98</td>
<td>2</td>
<td>1</td>
</tr>
<tr>
<td>34</td>
<td>3</td>
<td>0</td>
</tr>
</tbody></table>
<h4 id="입출력-예-설명">입출력 예 설명</h4>
<p><strong>입출력 예 #1</strong></p>
<p>98은 2의 배수이므로 1을 반환합니다.</p>
<p><strong>입출력 예 #2</strong></p>
<p>34는 3의 배수가 아니므로 0을 반환합니다.</p>
<hr>
<h3 id="내-코드">내 코드</h3>
<pre><code class="language-java">class Solution {
    public int solution(int num, int n) {
        int answer = 1;
        if (num % n != 0) {
            answer = 0;
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p><code>answer</code>의 초기값 : <code>n</code>의 배수가 맞을 땐 1이므로 <code>if</code>문의 조건이 배수가 아닐 때의 0을 가지므로 초기값을 0으로 선언함.</p>
</li>
<li><p><code>if</code>문 조건 : <code>num</code>이 <code>n</code>의 배수인 것이 아닌것을 알려주는 조건문임.</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] 문자열 곱하기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-%EB%AC%B8%EC%9E%90%EC%97%B4-%EA%B3%B1%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-%EB%AC%B8%EC%9E%90%EC%97%B4-%EA%B3%B1%ED%95%98%EA%B8%B0</guid>
            <pubDate>Sun, 10 Dec 2023 14:22:59 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>문자열 <code>my_string</code>과 정수 <code>k</code>가 주어질 때, <code>my_string</code>을 <code>k</code>번 반복한 문자열을 반환하는 <code>solution</code> 함수를 작성해 주세요.</p>
<h4 id="제한사항">제한사항</h4>
<ul>
<li>1 ≤ <code>my_string</code>의 길이 ≤ 100</li>
<li><code>my_string</code>은 영소문자로만 이루어져 있습니다.</li>
<li>1 ≤ <code>k</code> ≤ 100</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>my_string</th>
<th>k</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;string&quot;</td>
<td>3</td>
<td>&quot;stringstringstring&quot;</td>
</tr>
<tr>
<td>&quot;love&quot;</td>
<td>10</td>
<td>&quot;lovelovelovelovelovelovelovelovelovelove&quot;</td>
</tr>
</tbody></table>
<h4 id="입출력-예-설명">입출력 예 설명</h4>
<p><strong>입출력 예 #1</strong></p>
<p>예제 1번의 <code>my_string</code>은 &quot;string&quot;이고 이를 3번 반복한 문자열은 &quot;stringstringstring&quot;이므로 이를 반환합니다.</p>
<p><strong>입출력 예 #2</strong></p>
<p>예제 2번의 <code>my_string</code>은 &quot;love&quot;이고 이를 10번 반복한 문자열은 &quot;lovelovelovelovelovelovelovelovelovelove&quot;이므로 이를 반환합니다.</p>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public String solution(String my_string, int k) {
        String answer = &quot;&quot;;
        for(int i = 0; i &lt; k; i++){
            answer += my_string;
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><p><code>for</code>문 : 변수 <code>k</code> 만큼 반복하기 위한 <code>for</code>문임.</p>
</li>
<li><p><code>String</code> 타입 : <code>+</code> 기호를 사용하여 같은 타입에 다른 변수에 넣을 수 있음.</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[[ Lv.0 ] flag에 따라 다른 값 반환하기]]></title>
            <link>https://velog.io/@bnm_08/Lv.0-flag%EC%97%90-%EB%94%B0%EB%9D%BC-%EB%8B%A4%EB%A5%B8-%EA%B0%92-%EB%B0%98%ED%99%98%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@bnm_08/Lv.0-flag%EC%97%90-%EB%94%B0%EB%9D%BC-%EB%8B%A4%EB%A5%B8-%EA%B0%92-%EB%B0%98%ED%99%98%ED%95%98%EA%B8%B0</guid>
            <pubDate>Sun, 10 Dec 2023 14:13:24 GMT</pubDate>
            <description><![CDATA[<h2 id="문제-설명">문제 설명</h2>
<p>두 정수 <code>a</code>, <code>b</code>와 논리 변수 <code>flag</code>가 매개변수로 주어질 때, <code>flag</code>가 <code>true</code>면 <code>a + b</code>를 <code>false</code>면 <code>a - b</code>를 반환하는 <code>solution</code> 함수를 작성해 주세요.</p>
<h3 id="제한사항">제한사항</h3>
<ul>
<li>-1,000 ≤ <code>a</code>, <code>b</code> ≤ 1,000</li>
</ul>
<h3 id="입출력-예">입출력 예</h3>
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
<th>flag</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>-4</td>
<td>7</td>
<td>true</td>
<td>3</td>
</tr>
<tr>
<td>-4</td>
<td>7</td>
<td>false</td>
<td>-11</td>
</tr>
</tbody></table>
<h3 id="입출력-예-설명">입출력 예 설명</h3>
<p><strong>입출력 예 #1</strong></p>
<ul>
<li>예제 1번에서 <code>flag</code>가 <code>true</code>이므로 <code>a + b = (-4) + 7 = 3</code>을 반환합니다.</li>
</ul>
<p><strong>입출력 예 #2</strong></p>
<ul>
<li>예제 2번에서 <code>flag</code>가 <code>false</code>이므로 <code>a - b = (-4) - 7 = -11</code>을 반환합니다.</li>
</ul>
<hr>
<h2 id="내-코드">내 코드</h2>
<pre><code class="language-java">class Solution {
    public int solution(int a, int b, boolean flag) {
        int answer = a - b;
        if (flag) {
            answer = a + b;
        }
        return answer;
    }
}</code></pre>
<h3 id="설명">설명</h3>
<ul>
<li><code>answer</code>의 초기값 : <code>flag</code>가 <code>false</code>일 때 a - b 이므로 코드 단축을 위해 초기값을 선언함.</li>
</ul>
]]></description>
        </item>
    </channel>
</rss>