<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>hye-velog</title>
        <link>https://velog.io/</link>
        <description>Junior Backend Developer</description>
        <lastBuildDate>Thu, 11 May 2023 07:54:26 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>hye-velog</title>
            <url>https://velog.velcdn.com/images/hye-velog/profile/558abfd6-f98d-4470-aa5d-b59577e418ef/image.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. hye-velog. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/hye-velog" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[CodingTest] 삼각형의 완성조건 (2)]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%82%BC%EA%B0%81%ED%98%95%EC%9D%98-%EC%99%84%EC%84%B1%EC%A1%B0%EA%B1%B4-2</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%82%BC%EA%B0%81%ED%98%95%EC%9D%98-%EC%99%84%EC%84%B1%EC%A1%B0%EA%B1%B4-2</guid>
            <pubDate>Thu, 11 May 2023 07:54:26 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>선분 세 개로 삼각형을 만들기 위해서는 다음과 같은 조건을 만족해야 합니다.</p>
<ul>
<li>가장 긴 변의 길이는 다른 두 변의 길이의 합보다 작아야 합니다.</li>
</ul>
<p>삼각형의 두 변의 길이가 담긴 배열 sides이 매개변수로 주어집니다. 나머지 한 변이 될 수 있는 정수의 개수를 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>sides의 원소는 자연수입니다.</li>
<li>sides의 길이는 2입니다.</li>
<li>1 ≤ sides의 원소 ≤ 1,000</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>sides</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>[1, 2]</td>
<td>1</td>
</tr>
<tr>
<td>[3, 6]</td>
<td>5</td>
</tr>
<tr>
<td>[11, 7]</td>
<td>13</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1</p>
<ul>
<li>두 변이 1, 2 인 경우 삼각형을 완성시키려면 나머지 한 변이 2여야 합니다. 따라서 1을 return합니다.</li>
</ul>
</li>
<li><p>입출력 예 #2</p>
<ul>
<li>가장 긴 변이 6인 경우<ul>
<li>될 수 있는 나머지 한 변은 4, 5, 6 로 3개입니다.</li>
</ul>
</li>
<li>나머지 한 변이 가장 긴 변인 경우<ul>
<li>될 수 있는 한 변은 7, 8 로 2개입니다.</li>
</ul>
</li>
<li>따라서 3 + 2 = 5를 return합니다.</li>
</ul>
</li>
<li><p>입출력 예 #3</p>
<ul>
<li>가장 긴 변이 11인 경우<ul>
<li>될 수 있는 나머지 한 변은 5, 6, 7, 8, 9, 10, 11 로 7개입니다.</li>
</ul>
</li>
<li>나머지 한 변이 가장 긴 변인 경우<ul>
<li>될 수 있는 한 변은 12, 13, 14, 15, 16, 17 로 6개입니다.</li>
</ul>
</li>
<li>따라서 7 + 6 = 13을 return합니다.</li>
</ul>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int[] sides) {
        int answer = 0;
        if(sides[0] &gt; sides[1]) {
            answer += sides[1];
            answer += sides[0] + sides[1] - sides[0] - 1;
                   // sides[0] + sides[1] - sides[0] - 1;
        } else if (sides[0] &lt; sides[1]) {
            answer += sides[0];
                  // sides[1] - (sides[1] - sides[0]);
            answer += sides[0] - 1;
        } else {
            answer += sides[0];
                  // sides[1] - (sides[1] - sides[0]);
            answer += sides[0] - 1;
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>풀이를 보면 쉬워보이는데 뭔가 꼬이게 생각해서 쉽게 풀진않았네...
else if 랑  else 랑 케이스는 다른데 풀이는 같아서 합칠 수 있음.</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120868/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120868/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 치킨 쿠폰]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%B9%98%ED%82%A8-%EC%BF%A0%ED%8F%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%B9%98%ED%82%A8-%EC%BF%A0%ED%8F%B0</guid>
            <pubDate>Wed, 10 May 2023 07:58:09 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>프로그래머스 치킨은 치킨을 시켜먹으면 한 마리당 쿠폰을 한 장 발급합니다. 쿠폰을 열 장 모으면 치킨을 한 마리 서비스로 받을 수 있고, 서비스 치킨에도 쿠폰이 발급됩니다. 시켜먹은 치킨의 수 chicken이 매개변수로 주어질 때 받을 수 있는 최대 서비스 치킨의 수를 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>chicken은 정수입니다.</li>
<li>0 ≤ chicken ≤ 1,000,000</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>chicken</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>100</td>
<td>11</td>
</tr>
<tr>
<td>1,081</td>
<td>120</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1</p>
<ul>
<li>100마리를 주문하면 쿠폰이 100장 발급되므로 서비스 치킨 10마리를 주문할 수 있습니다.</li>
<li>10마리를 주문하면 쿠폰이 10장 발급되므로 서비스 치킨 1마리를 주문할 수 있습니다.</li>
<li>따라서 10 + 1 = 11 을 return합니다.</li>
</ul>
</li>
<li><p>입출력 예 #2</p>
<ul>
<li>1081마리를 주문하면 쿠폰이 1081장 발급되므로 서비스 치킨 108마리를 주문할 수 있습니다. 그리고 쿠폰이 1장 남습니다.</li>
<li>108마리를 주문하면 쿠폰이 108장 발급되므로 서비스 치킨 10마리를 주문할 수 있습니다. 그리고 쿠폰이 8장 남습니다.</li>
<li>10마리를 주문하면 쿠폰이 10장 발급되므로 서비스 치킨 1마리를 주문할 수 있습니다.</li>
<li>1마리를 주문하면 쿠폰이 1장 발급됩니다.</li>
<li>가지고 있는 쿠폰이 총 10장이므로 서비스 치킨 1마리를 추가로 주문할 수 있습니다.</li>
<li>따라서 108 + 10 + 1 + 1 = 120 을 return합니다.</li>
</ul>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int chicken) {
        int answer = 0;
        int temp = 0;
        int coupon = chicken;
        while (coupon &gt;= 1) {
            temp += coupon % 10;
            coupon = coupon / 10;
            answer += coupon;
            if(temp &gt;= 10){
                answer += 1;
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>몸이 심각하게 안좋아서 며칠 빠짐... 아직 나은게 아니라서 들쭉날쭉 할 듯.</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120884/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120884/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 로그인 성공?
]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EB%A1%9C%EA%B7%B8%EC%9D%B8-%EC%84%B1%EA%B3%B5</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EB%A1%9C%EA%B7%B8%EC%9D%B8-%EC%84%B1%EA%B3%B5</guid>
            <pubDate>Fri, 05 May 2023 14:46:53 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>머쓱이는 프로그래머스에 로그인하려고 합니다. 머쓱이가 입력한 아이디와 패스워드가 담긴 배열 id_pw와 회원들의 정보가 담긴 2차원 배열 db가 주어질 때, 다음과 같이 로그인 성공, 실패에 따른 메시지를 return하도록 solution 함수를 완성해주세요.</p>
<ul>
<li>아이디와 비밀번호가 모두 일치하는 회원정보가 있으면 &quot;login&quot;을 return합니다.</li>
<li>로그인이 실패했을 때 아이디가 일치하는 회원이 없다면 “fail”를, 아이디는 일치하지만 비밀번호가 일치하는 회원이 없다면 “wrong pw”를 return 합니다.</li>
</ul>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>회원들의 아이디는 문자열입니다.</li>
<li>회원들의 아이디는 알파벳 소문자와 숫자로만 이루어져 있습니다.</li>
<li>회원들의 패스워드는 숫자로 구성된 문자열입니다.</li>
<li>회원들의 비밀번호는 같을 수 있지만 아이디는 같을 수 없습니다.</li>
<li>id_pw의 길이는 2입니다.</li>
<li>id_pw와 db의 원소는 [아이디, 패스워드] 형태입니다.</li>
<li>1 ≤ 아이디의 길이 ≤ 15</li>
<li>1 ≤ 비밀번호의 길이 ≤ 6</li>
<li>1 ≤ db의 길이 ≤ 10</li>
<li>db의 원소의 길이는 2입니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>id_pw</th>
<th>db</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>[&quot;meosseugi&quot;, &quot;1234&quot;]</td>
<td>[[&quot;rardss&quot;, &quot;123&quot;], [&quot;yyoom&quot;, &quot;1234&quot;], [&quot;meosseugi&quot;, &quot;1234&quot;]]</td>
<td>&quot;login&quot;</td>
</tr>
<tr>
<td>[&quot;programmer01&quot;, &quot;15789&quot;]</td>
<td>[[&quot;programmer02&quot;, &quot;111111&quot;], [&quot;programmer00&quot;, &quot;134&quot;], [&quot;programmer01&quot;, &quot;1145&quot;]]</td>
<td>&quot;wrong pw&quot;</td>
</tr>
<tr>
<td>[&quot;rabbit04&quot;, &quot;98761&quot;]</td>
<td>[[&quot;jaja11&quot;, &quot;98761&quot;], [&quot;krong0313&quot;, &quot;29440&quot;], [&quot;rabbit00&quot;, &quot;111333&quot;]]</td>
<td>&quot;fail&quot;</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
db에 같은 정보의 계정이 있으므로 &quot;login&quot;을 return합니다.</p>
</li>
<li><p>입출력 예 #2
db에 아이디는 같지만 패스워드가 다른 계정이 있으므로 &quot;wrong pw&quot;를 return합니다.</p>
</li>
<li><p>입출력 예 #3
db에 아이디가 맞는 계정이 없으므로 &quot;fail&quot;을 return합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public String solution(String[] id_pw, String[][] db) {
        for(String[] idpw : db){
            if(idpw[0].equals(id_pw[0]) &amp;&amp; !idpw[1].equals(id_pw[1])){
                return  &quot;wrong pw&quot;;
            } else if(idpw[0].equals(id_pw[0]) &amp;&amp; idpw[1].equals(id_pw[1])){
                return  &quot;login&quot;;
            }
        }
        return &quot;fail&quot;;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>equals랑 == 이랑 다른 이유가 뭘까. ide에선 되는게 프로그래머스에선 안되니까 더 확신이 안생김.</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120883/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120883/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 구슬을 나누는 경우의 수]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EA%B5%AC%EC%8A%AC%EC%9D%84-%EB%82%98%EB%88%84%EB%8A%94-%EA%B2%BD%EC%9A%B0%EC%9D%98-%EC%88%98</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EA%B5%AC%EC%8A%AC%EC%9D%84-%EB%82%98%EB%88%84%EB%8A%94-%EA%B2%BD%EC%9A%B0%EC%9D%98-%EC%88%98</guid>
            <pubDate>Thu, 04 May 2023 14:32:58 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>머쓱이는 구슬을 친구들에게 나누어주려고 합니다. 구슬은 모두 다르게 생겼습니다. 머쓱이가 갖고 있는 구슬의 개수 balls와 친구들에게 나누어 줄 구슬 개수 share이 매개변수로 주어질 때, balls개의 구슬 중 share개의 구슬을 고르는 가능한 모든 경우의 수를 return 하는 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ balls ≤ 30</li>
<li>1 ≤ share ≤ 30</li>
<li>구슬을 고르는 순서는 고려하지 않습니다.</li>
<li>share ≤ balls</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>balls</th>
<th>share</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>3</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>5</td>
<td>3</td>
<td>10</td>
</tr>
</tbody></table>
<ul>
<li>서로 다른 n개 중 m개를 뽑는 경우의 수 공식은 다음과 같습니다.
<img src="https://velog.velcdn.com/images/hye-velog/post/e3d795cb-f799-4826-9222-418fcacf0655/image.png" alt=""></li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int balls, int share) {
        double ballsFac = 1;
        double shareFac = 1;
        double nmFac = 1;

        for(int i = 1; i &lt;= balls; i++){
            ballsFac *= i;
        }
        for(int i = 1; i &lt;= share; i++){
            shareFac *= i;
        }
        if((balls-share)!=0){
            for(int i = 1; i &lt;= (balls-share); i++){
                nmFac *= i;
            }
        } else {
            return 1;
        }
        return (int) Math.round(ballsFac/(nmFac*shareFac));
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>Hint대로 식 짜서 만든건데 소용이 없어서 다른 분들의 질문 보면서 어떤 케이스가 누락되었을까 참고해서 완성. 7점이나 나오네.</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120840/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120840/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 숨어있는 숫자의 덧셈 (2)]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%88%A8%EC%96%B4%EC%9E%88%EB%8A%94-%EC%88%AB%EC%9E%90%EC%9D%98-%EB%8D%A7%EC%85%88-2</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%88%A8%EC%96%B4%EC%9E%88%EB%8A%94-%EC%88%AB%EC%9E%90%EC%9D%98-%EB%8D%A7%EC%85%88-2</guid>
            <pubDate>Wed, 03 May 2023 00:13:56 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>문자열 my_string이 매개변수로 주어집니다. my_string은 소문자, 대문자, 자연수로만 구성되어있습니다. my_string안의 자연수들의 합을 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ my_string의 길이 ≤ 1,000</li>
<li>1 ≤ my_string 안의 자연수 ≤ 1000</li>
<li>연속된 수는 하나의 숫자로 간주합니다.</li>
<li>000123과 같이 0이 선행하는 경우는 없습니다.</li>
<li>문자열에 자연수가 없는 경우 0을 return 해주세요.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>my_string</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;aAb1B2cC34oOp&quot;</td>
<td>37</td>
</tr>
<tr>
<td>&quot;1a2b3c4d123Z&quot;</td>
<td>133</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
&quot;aAb1B2cC34oOp&quot;안의 자연수는 1, 2, 34 입니다. 따라서 1 + 2 + 34 = 37 을 return합니다.</p>
</li>
<li><p>입출력 예 #2
&quot;1a2b3c4d123Z&quot;안의 자연수는 1, 2, 3, 4, 123 입니다. 따라서 1 + 2 + 3 + 4 + 123 = 133 을 return합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(String my_string) {
        int answer = 0;
        String[] arr = my_string.split(&quot;[A-Za-z]&quot;);
        for(String i : arr){
            if(!i.equals(&quot;&quot;)){
                answer += Integer.parseInt(i);
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>오 문자 자르기 관련 스텍오버플로우에 나와있는 regex 관련 내용 굿
<a href="https://stackoverflow.com/questions/16787099/how-to-split-the-string-into-string-and-integer-in-java">https://stackoverflow.com/questions/16787099/how-to-split-the-string-into-string-and-integer-in-java</a></li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120864/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120864/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 7의 개수]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-7%EC%9D%98-%EA%B0%9C%EC%88%98</link>
            <guid>https://velog.io/@hye-velog/CodingTest-7%EC%9D%98-%EA%B0%9C%EC%88%98</guid>
            <pubDate>Tue, 02 May 2023 00:53:28 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>머쓱이는 행운의 숫자 7을 가장 좋아합니다. 정수 배열 array가 매개변수로 주어질 때, 7이 총 몇 개 있는지 return 하도록 solution 함수를 완성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ array의 길이 ≤ 100</li>
<li>0 ≤ array의 원소 ≤ 100,000</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>array</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>[7, 77, 17]</td>
<td>4</td>
</tr>
<tr>
<td>[10, 29]</td>
<td>0</td>
</tr>
</tbody></table>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int[] array) {
        int answer = 0;
        for(int i : array){
            String[] str = String.valueOf(i).split(&quot;&quot;);
            for(String s : str){
                if(s.equals(&quot;7&quot;)){
                    answer++;
                }
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>나누기와 몫을 활용하자.<pre><code class="language-java">class Solution {
  public int solution(int[] array) {
      int answer = 0;
      for(int a : array){
          while(a != 0){
              if(a % 10 == 7){
                  answer++;
              }
              a /= 10;
          }
      }
      return answer;
  }
}</code></pre>
</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120912/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120912/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 컨트롤 제트]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%BB%A8%ED%8A%B8%EB%A1%A4-%EC%A0%9C%ED%8A%B8</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%BB%A8%ED%8A%B8%EB%A1%A4-%EC%A0%9C%ED%8A%B8</guid>
            <pubDate>Sun, 30 Apr 2023 12:09:36 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>숫자와 &quot;Z&quot;가 공백으로 구분되어 담긴 문자열이 주어집니다. 문자열에 있는 숫자를 차례대로 더하려고 합니다. 이 때 &quot;Z&quot;가 나오면 바로 전에 더했던 숫자를 뺀다는 뜻입니다. 숫자와 &quot;Z&quot;로 이루어진 문자열 s가 주어질 때, 머쓱이가 구한 값을 return 하도록 solution 함수를 완성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ s의 길이 ≤ 200</li>
<li>-1,000 &lt; s의 원소 중 숫자 &lt; 1,000</li>
<li>s는 숫자, &quot;Z&quot;, 공백으로 이루어져 있습니다.</li>
<li>s에 있는 숫자와 &quot;Z&quot;는 서로 공백으로 구분됩니다.</li>
<li>연속된 공백은 주어지지 않습니다.</li>
<li>0을 제외하고는 0으로 시작하는 숫자는 없습니다.</li>
<li>s는 &quot;Z&quot;로 시작하지 않습니다.</li>
<li>s의 시작과 끝에는 공백이 없습니다.</li>
<li>&quot;Z&quot;가 연속해서 나오는 경우는 없습니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>s</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;1 2 Z 3&quot;</td>
<td>4</td>
</tr>
<tr>
<td>&quot;10 20 30 40&quot;</td>
<td>100</td>
</tr>
<tr>
<td>&quot;10 Z 20 Z 1&quot;</td>
<td>1</td>
</tr>
<tr>
<td>&quot;10 Z 20 Z&quot;</td>
<td>0</td>
</tr>
<tr>
<td>&quot;-1 -2 -3 Z&quot;</td>
<td>-3</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
본문과 동일합니다.</p>
</li>
<li><p>입출력 예 #2
10 + 20 + 30 + 40 = 100을 return 합니다.</p>
</li>
<li><p>입출력 예 #3
&quot;10 Z 20 Z 1&quot;에서 10 다음 Z, 20 다음 Z로 10, 20이 지워지고 1만 더하여 1을 return 합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(String s) {
        int answer = 0;
        int temp = 0;
        String[] arr = s.split(&quot; &quot;);
        for(int i = 0; i &lt; arr.length; i++){
            if(!arr[i].equals(&quot;Z&quot;)){
                answer += Integer.parseInt(arr[i]);
                temp = Integer.parseInt(arr[i]);
            }
            if(arr[i].equals(&quot;Z&quot;)){
                answer -= temp;
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>Stack으로 푼 풀이들이 많네? 확인해볼 것</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120853/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120853/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] k의 개수]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-k%EC%9D%98-%EA%B0%9C%EC%88%98</link>
            <guid>https://velog.io/@hye-velog/CodingTest-k%EC%9D%98-%EA%B0%9C%EC%88%98</guid>
            <pubDate>Sat, 29 Apr 2023 13:32:19 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>1부터 13까지의 수에서, 1은 1, 10, 11, 12, 13 이렇게 총 6번 등장합니다. 정수 i, j, k가 매개변수로 주어질 때, i부터 j까지 k가 몇 번 등장하는지 return 하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ i &lt; j ≤ 100,000</li>
<li>0 ≤ k ≤ 9</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>i</th>
<th>j</th>
<th>k</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>13</td>
<td>1</td>
<td>6</td>
</tr>
<tr>
<td>10</td>
<td>50</td>
<td>5</td>
<td>5</td>
</tr>
<tr>
<td>3</td>
<td>10</td>
<td>2</td>
<td>0</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
본문과 동일합니다.</p>
</li>
<li><p>입출력 예 #2
10부터 50까지 5는 15, 25, 35, 45, 50 총 5번 등장합니다. 따라서 5를 return 합니다.</p>
</li>
<li><p>입출력 예 #3
3부터 10까지 2는 한 번도 등장하지 않으므로 0을 return 합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int i, int j, int k) {
        int answer = 0;
        for(; i &lt;= j; i++){
            String[] iStr = String.valueOf(i).split(&quot;&quot;);
            for(int c = 0; c &lt; iStr.length; c++){
                if(iStr[c].equals(String.valueOf(k))){
                    answer++;
                }
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li><p>오 간단..</p>
<pre><code class="language-java">class Solution {
  public int solution(int i, int j, int k) {
      String str = &quot;&quot;;
      for(int a = i; a &lt;= j; a++) {
          str += a+&quot;&quot;;
      }

      return str.length() - str.replace(k+&quot;&quot;, &quot;&quot;).length();
  }
}</code></pre>
</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120887/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120887/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 팩토리얼]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%ED%8C%A9%ED%86%A0%EB%A6%AC%EC%96%BC</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%ED%8C%A9%ED%86%A0%EB%A6%AC%EC%96%BC</guid>
            <pubDate>Fri, 28 Apr 2023 11:20:44 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>i팩토리얼 (i!)은 1부터 i까지 정수의 곱을 의미합니다. 예를들어 5! = 5 * 4 * 3 * 2 * 1 = 120 입니다. 정수 n이 주어질 때 다음 조건을 만족하는 가장 큰 정수 i를 return 하도록 solution 함수를 완성해주세요.</p>
<ul>
<li>i! ≤ n</li>
</ul>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>0 &lt; n ≤ 3,628,800</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>n</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>3628800</td>
<td>10</td>
</tr>
<tr>
<td>7</td>
<td>3</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
10! = 3,628,800입니다. n이 3628800이므로 최대 팩토리얼인 10을 return 합니다.</p>
</li>
<li><p>입출력 예 #2
3! = 6, 4! = 24입니다. n이 7이므로, 7 이하의 최대 팩토리얼인 3을 return 합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int n) {
        int sum = 1;
        int count = 0;
        for(int i = 1; i &lt; 11; i++){
            sum *= i;
            if(n &lt; sum){
                break;
            }
            count++;
        }
        return count;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120848/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120848/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 모스부호 (1)]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EB%AA%A8%EC%8A%A4%EB%B6%80%ED%98%B8-1</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EB%AA%A8%EC%8A%A4%EB%B6%80%ED%98%B8-1</guid>
            <pubDate>Thu, 27 Apr 2023 05:33:47 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>머쓱이는 친구에게 모스부호를 이용한 편지를 받았습니다. 그냥은 읽을 수 없어 이를 해독하는 프로그램을 만들려고 합니다. 문자열 letter가 매개변수로 주어질 때, letter를 영어 소문자로 바꾼 문자열을 return 하도록 solution 함수를 완성해보세요.
모스부호는 다음과 같습니다.</p>
<blockquote>
<p>morse = { 
    &#39;.-&#39;:&#39;a&#39;,&#39;-...&#39;:&#39;b&#39;,&#39;-.-.&#39;:&#39;c&#39;,&#39;-..&#39;:&#39;d&#39;,&#39;.&#39;:&#39;e&#39;,&#39;..-.&#39;:&#39;f&#39;,
    &#39;--.&#39;:&#39;g&#39;,&#39;....&#39;:&#39;h&#39;,&#39;..&#39;:&#39;i&#39;,&#39;.---&#39;:&#39;j&#39;,&#39;-.-&#39;:&#39;k&#39;,&#39;.-..&#39;:&#39;l&#39;,
    &#39;--&#39;:&#39;m&#39;,&#39;-.&#39;:&#39;n&#39;,&#39;---&#39;:&#39;o&#39;,&#39;.--.&#39;:&#39;p&#39;,&#39;--.-&#39;:&#39;q&#39;,&#39;.-.&#39;:&#39;r&#39;,
    &#39;...&#39;:&#39;s&#39;,&#39;-&#39;:&#39;t&#39;,&#39;..-&#39;:&#39;u&#39;,&#39;...-&#39;:&#39;v&#39;,&#39;.--&#39;:&#39;w&#39;,&#39;-..-&#39;:&#39;x&#39;,
    &#39;-.--&#39;:&#39;y&#39;,&#39;--..&#39;:&#39;z&#39;
}</p>
</blockquote>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ letter의 길이 ≤ 1,000</li>
<li>return값은 소문자입니다.</li>
<li>letter의 모스부호는 공백으로 나누어져 있습니다.</li>
<li>letter에 공백은 연속으로 두 개 이상 존재하지 않습니다.</li>
<li>해독할 수 없는 편지는 주어지지 않습니다.</li>
<li>편지의 시작과 끝에는 공백이 없습니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>letter</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;.... . .-.. .-.. ---&quot;</td>
<td>&quot;hello&quot;</td>
</tr>
<tr>
<td>&quot;.--. -.-- - .... --- -.&quot;</td>
<td>&quot;python&quot;</td>
</tr>
</tbody></table>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public String solution(String letter) {
        StringBuilder answer = new StringBuilder();
        String[] str = letter.split(&quot; &quot;);
        for(int i = 0; i &lt; str.length; i++){
            if(str[i].equals(&quot;.-&quot;)){
                answer.append(&quot;a&quot;);
            } else if (str[i].equals(&quot;-...&quot;)) {
                answer.append(&quot;b&quot;);
            } else if (str[i].equals(&quot;-.-.&quot;)) {
                answer.append(&quot;c&quot;);
            } else if (str[i].equals(&quot;-..&quot;)) {
                answer.append(&quot;d&quot;);
            } else if (str[i].equals(&quot;.&quot;)) {
                answer.append(&quot;e&quot;);
            } else if (str[i].equals(&quot;..-.&quot;)) {
                answer.append(&quot;f&quot;);
            } else if (str[i].equals(&quot;--.&quot;)) {
                answer.append(&quot;g&quot;);
            } else if (str[i].equals(&quot;....&quot;)) {
                answer.append(&quot;h&quot;);
            } else if (str[i].equals(&quot;..&quot;)) {
                answer.append(&quot;i&quot;);
            } else if (str[i].equals(&quot;.---&quot;)) {
                answer.append(&quot;j&quot;);
            } else if (str[i].equals(&quot;-.-&quot;)) {
                answer.append(&quot;k&quot;);
            } else if (str[i].equals(&quot;.-..&quot;)) {
                answer.append(&quot;l&quot;);
            } else if (str[i].equals(&quot;--&quot;)) {
                answer.append(&quot;m&quot;);
            } else if (str[i].equals(&quot;-.&quot;)) {
                answer.append(&quot;n&quot;);
            } else if (str[i].equals(&quot;---&quot;)) {
                answer.append(&quot;o&quot;);
            } else if (str[i].equals(&quot;.--.&quot;)) {
                answer.append(&quot;p&quot;);
            } else if (str[i].equals(&quot;--.-&quot;)) {
                answer.append(&quot;q&quot;);
            } else if (str[i].equals(&quot;.-.&quot;)) {
                answer.append(&quot;r&quot;);
            } else if (str[i].equals(&quot;...&quot;)) {
                answer.append(&quot;s&quot;);
            } else if (str[i].equals(&quot;-&quot;)) {
                answer.append(&quot;t&quot;);
            } else if (str[i].equals(&quot;..-&quot;)) {
                answer.append(&quot;u&quot;);
            } else if (str[i].equals(&quot;...-&quot;)) {
                answer.append(&quot;v&quot;);
            } else if (str[i].equals(&quot;.--&quot;)) {
                answer.append(&quot;w&quot;);
            } else if (str[i].equals(&quot;-..-&quot;)) {
                answer.append(&quot;x&quot;);
            } else if (str[i].equals(&quot;-.--&quot;)) {
                answer.append(&quot;y&quot;);
            } else if (str[i].equals(&quot;--..&quot;)) {
                answer.append(&quot;z&quot;);
            }
        }
        return answer.toString();
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>어떻게해야 간단히.... 노가다가 아니지..?</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120838/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120838/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 숫자 찾기]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%88%AB%EC%9E%90-%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%88%AB%EC%9E%90-%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Wed, 26 Apr 2023 08:32:15 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>정수 num과 k가 매개변수로 주어질 때, num을 이루는 숫자 중에 k가 있으면 num의 그 숫자가 있는 자리 수를 return하고 없으면 -1을 return 하도록 solution 함수를 완성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>0 &lt; num &lt; 1,000,000</li>
<li>0 ≤ k &lt; 10</li>
<li>num에 k가 여러 개 있으면 가장 처음 나타나는 자리를 return 합니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>num</th>
<th>k</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>29183</td>
<td>1</td>
<td>3</td>
</tr>
<tr>
<td>232443</td>
<td>4</td>
<td>4</td>
</tr>
<tr>
<td>123456</td>
<td>7</td>
<td>-1</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
29183에서 1은 3번째에 있습니다.</p>
</li>
<li><p>입출력 예 #2
232443에서 4는 4번째에 처음 등장합니다</p>
</li>
<li><p>입출력 예 #3
123456에 7은 없으므로 -1을 return 합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int num, int k) {
        int answer = 0;
        String[] arr = Integer.toString(num).split(&quot;&quot;);
        for (String s : arr) {
            answer++;
            if (s.equals(Integer.toString(k))) {
                return answer;
            }
        }
        return -1;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>다른 분들 풀이 볼 것!</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120904/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120904/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 0레벨 코딩 기초 트레이닝]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-0%EB%A0%88%EB%B2%A8-%EC%BD%94%EB%94%A9-%EA%B8%B0%EC%B4%88-%ED%8A%B8%EB%A0%88%EC%9D%B4%EB%8B%9D</link>
            <guid>https://velog.io/@hye-velog/CodingTest-0%EB%A0%88%EB%B2%A8-%EC%BD%94%EB%94%A9-%EA%B8%B0%EC%B4%88-%ED%8A%B8%EB%A0%88%EC%9D%B4%EB%8B%9D</guid>
            <pubDate>Tue, 25 Apr 2023 08:28:26 GMT</pubDate>
            <description><![CDATA[<p>이번에 프로그래머스에서 0레벨 코딩 기초 트레이닝이 업로드 되어서 
기존에 풀던 0레벨이 내가 보는 화면에서 뒤로 밀리는 현상이 발생해버렸다. 
기초 트레이닝 다 완료해서 기존 보던 화면대로 돌려놓는게 목표.
오늘 하루동안 아래와 같이 풀었다.
100여문제나 되어서 아직 30% 밖에 못 풀었다. 86문제 남았네.</p>
<p><img src="https://velog.velcdn.com/images/hye-velog/post/0c63c853-af18-4945-895b-d06da84d6349/image.png" alt=""></p>
<hr>
<h1 id="내용-외우거나-익히거나-깨달은-내용-메모해-둔-것">내용 외우거나 익히거나 깨달은 내용 메모해 둔 것</h1>
<p>문자열 반복해서 출력하기 = 문자열 곱하기
str.repeat(n);
answer+=str;</p>
<p>특수문자 출력하기
System.out.println(&quot;!@#$%^&amp;*(\&#39;&quot;&lt;&gt;?:;&quot;);</p>
<p>문자열 붙여서 출력하기
?? 입력할 때 공백으로 구분되어지지않는데 문제가 왜 이러지.</p>
<p>홀짝 구분하기
문제에 오타 있다.
System.out.print(n + &quot; is &quot;);
System.out.println(n%2 == 0 ? &quot;even&quot; : &quot;odd&quot;);</p>
<p>정수 부분
(int) flo 하는게 정답...이었네................... ......
double 에서 int로 형 변환하면 소수점 사라짐.</p>
<p>n 번째 원소까지
풀 때 이거 많이 쓰네. Arrays.copyOfRange(num_list,0,n);</p>
<p>IntStream.rangeClosed(-start, -end).map(i -&gt; -i).toArray();</p>
<p>첫 번째로 나오는 음수
다른 사람의 풀이 그냥 공부용
return IntStream.range(0, numList.length).filter(i -&gt; numList[i] &lt; 0).findFirst().orElse(-1);
class Solution {
    public int solution(int[] num_list) {
        for(int i = 0 ; i &lt; num_list.length ; i++){
            if(num_list[i] &lt; 0){
                return i;
            }
        }
        return -1;
    }
}</p>
<p>.indexOf(&quot;@&quot;); </p>
<p>Arrays.stream(arr).map(x -&gt; x+k).toArray();</p>
<blockquote>
<blockquote>
<p>list 스트림 생성. 조건 입력. 배열로 출력</p>
</blockquote>
</blockquote>
<p>기억해두기
for (char x : num_str.toCharArray()) {
    answer += Integer.parseInt(String.valueOf(x));
}</p>
<p>원소들의 곱과 합
제곱
Math.pow(sum,2)</p>
<p>rny_string
answer =  String.join(&quot;&quot;,arr);</p>
<p>부분 문자열인지 확인하기
return my_string.indexOf(target) == -1 ? 0 : 1;
else 에 뭐가 들어갔었을까
if (my_string.indexOf(target) &gt; -1) {
                return 1;
            } else {
                return 0;
            } // 보다 크다?? 는이 아니라?
return (my_string.indexOf(target)&gt;=0)? 1:0;</p>
<hr>
<p>return my_string.contains(target) ? 1 : 0;
return my_string.length() == my_string.replace(target, &quot;&quot;).length() ? 0 : 1;
return my_string.indexOf(target) &gt; -1 ? 1 : 0;
String s = my_string.replace(target, &quot;&quot;);</p>
<pre><code>    if(my_string.equals(s)) {
        answer = 0;
    } else {
        answer = 1;
    }

    return answer;</code></pre><p>더 크게 합치기
class Solution {
    public int solution(int a, int b) {
        String abStr = (a + &quot;&quot;) + (b + &quot;&quot;);
        String baStr = (b + &quot;&quot;) + (a + &quot;&quot;);
        int abInt = Integer.parseInt(abStr);
        int baInt = Integer.parseInt(baStr);
        return abInt &gt; baInt ? abInt : baInt;
    }
}
int ab = Integer.parseInt(Integer.toString(a) + Integer.toString(b));</p>
<p>홀짝에 따라 다른 값 반환하기
for(int i = 1; i &lt;= n; i++){
                if(i % 2 == 0){
                    answer += i * i;
                }
            }
for (int num = 2;num &lt;= n;num += 2)
                answer += num * num;</p>
<p>수 조작하기 1
class Solution {
    public int solution(int n, String control) {
        int answer = n;
        String[] arr = control.split(&quot;&quot;);
        for(String str : arr){
            if(str.equals(&quot;w&quot;)){
                answer += 1; 
            } else if(str.equals(&quot;s&quot;)) {
                answer -= 1;
            } else if(str.equals(&quot;d&quot;)) {
                answer += 10;
            } else if(str.equals(&quot;a&quot;)) {
                answer -= 10;
            }
        }
        return answer;
    }
}
switch (abc[i]) {
                case &quot;w&quot; :
                    n += 1;
                    break;
                case &quot;s&quot; :
                    n -= 1;
                    break;
                case &quot;d&quot; :
                    n += 10;
                    break;
                case &quot;a&quot; :
                    n -= 10;
                    break;
                default:
                    break;
            }</p>
<p>문자열 섞기
속도얘가 빠름  2ms
class Solution {
    public String solution(String str1, String str2) {
        String answer = &quot;&quot;;
        String[] str1Arr = str1.split(&quot;&quot;);
        String[] str2Arr = str2.split(&quot;&quot;);
        for(int i = 0; i &lt; str1Arr.length; i++){
            answer += String.join(&quot;&quot;,str1Arr[i]);
            answer += String.join(&quot;&quot;,str2Arr[i]);
        }
        return answer;
    }
}
얘는 10ms
class Solution {
    public String solution(String str1, String str2) {
        String answer = &quot;&quot;;
        String[] str1Arr = str1.split(&quot;&quot;);
        String[] str2Arr = str2.split(&quot;&quot;);
        for(int i = 0; i &lt; str1Arr.length; i++){
            answer += (str1Arr[i] + str2Arr[i]);
        }
        return answer;
    }
}</p>
<p>문자열 돌리기
for (char ch : a.toCharArray())
System.out.println(a.charAt(i));</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 약수 구하기]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%95%BD%EC%88%98-%EA%B5%AC%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%95%BD%EC%88%98-%EA%B5%AC%ED%95%98%EA%B8%B0</guid>
            <pubDate>Tue, 25 Apr 2023 01:12:35 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>정수 n이 매개변수로 주어질 때, n의 약수를 오름차순으로 담은 배열을 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ n ≤ 10,000</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>n</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>24</td>
<td>[1, 2, 3, 4, 6, 8, 12, 24]</td>
</tr>
<tr>
<td>29</td>
<td>[1, 29]</td>
</tr>
</tbody></table>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">import java.util.*;
class Solution {
    public Integer[] solution(int n) {
        ArrayList&lt;Integer&gt; list = new ArrayList&lt;&gt;();
        for(int i = 1; i &lt;= n; i ++){
            if( n % i == 0 ){
                list.add(i);
            }
        }
        return list.toArray(new Integer[list.size()]);
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120897/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120897/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 369게임]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-369%EA%B2%8C%EC%9E%84</link>
            <guid>https://velog.io/@hye-velog/CodingTest-369%EA%B2%8C%EC%9E%84</guid>
            <pubDate>Mon, 24 Apr 2023 01:29:19 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>머쓱이는 친구들과 369게임을 하고 있습니다. 369게임은 1부터 숫자를 하나씩 대며 3, 6, 9가 들어가는 숫자는 숫자 대신 3, 6, 9의 개수만큼 박수를 치는 게임입니다. 머쓱이가 말해야하는 숫자 order가 매개변수로 주어질 때, 머쓱이가 쳐야할 박수 횟수를 return 하도록 solution 함수를 완성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ order ≤ 1,000,000</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>order</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>3</td>
<td>1</td>
</tr>
<tr>
<td>29423</td>
<td>2</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
3은 3이 1개 있으므로 1을 출력합니다.</p>
</li>
<li><p>입출력 예 #2
29423은 3이 1개, 9가 1개 있으므로 2를 출력합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int solution(int order) {
        int answer = 0;
        String strInt = String.valueOf(order);
        String[] intArr = strInt.split(&quot;&quot;);
        for (String str : intArr){
            if(str.equals(&quot;3&quot;)||str.equals(&quot;6&quot;)||str.equals(&quot;9&quot;)){
                answer++;
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>나눗셈으로 몫 3,6,9 구하는게 젤 간편한 방법이네. 지난번에도 봤었는데 생각 못하고 또 String 으로 변환해서 split 사용해서 카운트 처리함.</li>
</ul>
<pre><code class="language-java">class Solution {
    public int solution(int order) {
        int answer = 0;
        int count = 0;
        while(order != 0)
        {
            if(order % 10 == 3 || order % 10 == 6 || order % 10 == 9)
            {
                count++;
            }
             order = order/10;
        }
        answer = count;
        return answer;
    }
}</code></pre>
<ul>
<li>문자열 처리... <code>String str = order+&quot;&quot;;</code></li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120891/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120891/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 가장 큰 수 찾기]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EA%B0%80%EC%9E%A5-%ED%81%B0-%EC%88%98-%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EA%B0%80%EC%9E%A5-%ED%81%B0-%EC%88%98-%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Sun, 23 Apr 2023 12:15:50 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>정수 배열 array가 매개변수로 주어질 때, 가장 큰 수와 그 수의 인덱스를 담은 배열을 return 하도록 solution 함수를 완성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ array의 길이 ≤ 100</li>
<li>0 ≤ array 원소 ≤ 1,000</li>
<li>array에 중복된 숫자는 없습니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>array</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>[1, 8, 3]</td>
<td>[8, 1]</td>
</tr>
<tr>
<td>[9, 10, 11, 8]</td>
<td>[11, 2]</td>
</tr>
</tbody></table>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int[] solution(int[] array) {
        int temp = 0;
        int count = 0;
        for(int num : array){
            if(num &gt; temp){
                temp = num;
            }
        }
        for(int i = 0 ; i &lt; array.length ; i++){
            if(array[i] == temp){
                count = i;
                break;
            }
        }
        int[] answer = {temp, count};
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li><p>저렇게 두 번 안해도 되었을꺼같은데, answer 원소에 넣는게 더 맞네.</p>
<pre><code class="language-java">class Solution {
  public int[] solution(int[] array) {
      int[] answer = new int[2];

      for(int i=0;i&lt;array.length;i++) {
          if(array[i] &gt; answer[0]) {
              answer[0] = array[i];
              answer[1] = i;
          }
      }

      return answer;
  }
}</code></pre>
</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120899/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120899/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 외계행성의 나이]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%99%B8%EA%B3%84%ED%96%89%EC%84%B1%EC%9D%98-%EB%82%98%EC%9D%B4</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%99%B8%EA%B3%84%ED%96%89%EC%84%B1%EC%9D%98-%EB%82%98%EC%9D%B4</guid>
            <pubDate>Sat, 22 Apr 2023 14:27:21 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>우주여행을 하던 머쓱이는 엔진 고장으로 PROGRAMMERS-962 행성에 불시착하게 됐습니다. 입국심사에서 나이를 말해야 하는데, PROGRAMMERS-962 행성에서는 나이를 알파벳으로 말하고 있습니다. a는 0, b는 1, c는 2, ..., j는 9입니다. 예를 들어 23살은 cd, 51살은 fb로 표현합니다. 나이 age가 매개변수로 주어질 때 PROGRAMMER-962식 나이를 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>age는 자연수입니다.</li>
<li>age ≤ 1,000</li>
<li>PROGRAMMERS-962 행성은 알파벳 소문자만 사용합니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>age</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>23</td>
<td>&quot;cd&quot;</td>
</tr>
<tr>
<td>51</td>
<td>&quot;fb&quot;</td>
</tr>
<tr>
<td>100</td>
<td>&quot;baa&quot;</td>
</tr>
</tbody></table>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public String solution(int age) {
        String strAge = String.valueOf(age);
        String[] strAgeArr = strAge.split(&quot;&quot;);
        StringBuffer sb = new StringBuffer();
        for(String str : strAgeArr){
            if(str.equals(&quot;0&quot;)) {
                sb.append(&quot;a&quot;);
            } else if(str.equals(&quot;1&quot;)){
                sb.append(&quot;b&quot;);
            } else if(str.equals(&quot;2&quot;)){
                sb.append(&quot;c&quot;);
            } else if(str.equals(&quot;3&quot;)){
                sb.append(&quot;d&quot;);
            } else if(str.equals(&quot;4&quot;)){
                sb.append(&quot;e&quot;);
            } else if(str.equals(&quot;5&quot;)){
                sb.append(&quot;f&quot;);
            } else if(str.equals(&quot;6&quot;)){
                sb.append(&quot;g&quot;);
            } else if(str.equals(&quot;7&quot;)){
                sb.append(&quot;h&quot;);
            } else if(str.equals(&quot;8&quot;)){
                sb.append(&quot;i&quot;);
            } else if(str.equals(&quot;9&quot;)){
                sb.append(&quot;j&quot;);
            }
        }
        return sb.toString();
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>조건문 간단하게 하려면 어떻게 해야했을까 고민하게되는 문제.</li>
</ul>
<pre><code class="language-java">class Solution {
    public String solution(int age) {
        String answer = &quot;&quot;;
        String[] alpha = new String[]{&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;,&quot;f&quot;,&quot;g&quot;,&quot;h&quot;,&quot;i&quot;,&quot;j&quot;};

        while(age&gt;0){
            answer = alpha[age % 10] + answer;
            age /= 10;
        }

        return answer;
    }
}</code></pre>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120834/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120834/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 배열 회전시키기]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EB%B0%B0%EC%97%B4-%ED%9A%8C%EC%A0%84%EC%8B%9C%ED%82%A4%EA%B8%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EB%B0%B0%EC%97%B4-%ED%9A%8C%EC%A0%84%EC%8B%9C%ED%82%A4%EA%B8%B0</guid>
            <pubDate>Fri, 21 Apr 2023 04:15:31 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>정수가 담긴 배열 numbers와 문자열 direction가 매개변수로 주어집니다. 배열 numbers의 원소를 direction방향으로 한 칸씩 회전시킨 배열을 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>3 ≤ numbers의 길이 ≤ 20</li>
<li>direction은 &quot;left&quot; 와 &quot;right&quot; 둘 중 하나입니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>numbers</th>
<th>direction</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>[1, 2, 3]</td>
<td>&quot;right&quot;</td>
<td>[3, 1, 2]</td>
</tr>
<tr>
<td>[4, 455, 6, 4, -1, 45, 6]</td>
<td>&quot;left&quot;</td>
<td>[455, 6, 4, -1, 45, 6, 4]</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
numbers 가 [1, 2, 3]이고 direction이 &quot;right&quot; 이므로 오른쪽으로 한 칸씩 회전시킨 [3, 1, 2]를 return합니다.</p>
</li>
<li><p>입출력 예 #2
numbers 가 [4, 455, 6, 4, -1, 45, 6]이고 direction이 &quot;left&quot; 이므로 왼쪽으로 한 칸씩 회전시킨 [455, 6, 4, -1, 45, 6, 4]를 return합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public int[] solution(int[] numbers, String direction) {
        int[] answer = new int[numbers.length];
        if(direction.equals(&quot;right&quot;)) {
           answer[0] = numbers[numbers.length-1];
            for(int i = 1 ;  i &lt; numbers.length ; i++){
                answer[i] = numbers[i-1];
            }
        } else {
            answer[numbers.length-1] = numbers[0];
            for(int i = 0 ;  i &lt; numbers.length-1 ; i++){
                answer[i] = numbers[i+1];
            }
        }
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>배열 조건문 작성하는걸 왜 이렇게 삽질했지. 이 쉬운걸...</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120844/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120844/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 인덱스 바꾸기]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EC%9D%B8%EB%8D%B1%EC%8A%A4-%EB%B0%94%EA%BE%B8%EA%B8%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EC%9D%B8%EB%8D%B1%EC%8A%A4-%EB%B0%94%EA%BE%B8%EA%B8%B0</guid>
            <pubDate>Thu, 20 Apr 2023 00:49:16 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>문자열 my_string과 정수 num1, num2가 매개변수로 주어질 때, my_string에서 인덱스 num1과 인덱스 num2에 해당하는 문자를 바꾼 문자열을 return 하도록 solution 함수를 완성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 &lt; my_string의 길이 &lt; 100</li>
<li>0 ≤ num1, num2 &lt; my_string의 길이</li>
<li>my_string은 소문자로 이루어져 있습니다.</li>
<li>num1 ≠ num2</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>my_string</th>
<th>num1</th>
<th>num2</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;hello&quot;</td>
<td>1</td>
<td>2</td>
<td>&quot;hlelo&quot;</td>
</tr>
<tr>
<td>&quot;I love you&quot;</td>
<td>3</td>
<td>6</td>
<td>&quot;I l veoyou&quot;</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
&quot;hello&quot;의 1번째 인덱스인 &quot;e&quot;와 2번째 인덱스인 &quot;l&quot;을 바꾸면 &quot;hlelo&quot;입니다.</p>
</li>
<li><p>입출력 예 #2
&quot;I love you&quot;의 3번째 인덱스 &quot;o&quot;와 &quot; &quot;(공백)을 바꾸면 &quot;I l veoyou&quot;입니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">class Solution {
    public String solution(String my_string, int num1, int num2) {
        String temp = &quot;&quot;;
        String[] strArr = my_string.split(&quot;&quot;);
        temp = strArr[num1];
        strArr[num1] = strArr[num2];
        strArr[num2] = temp;
        return String.join(&quot;&quot;, strArr);
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li>아, join 말고도 그냥 + 하면 String 합쳐지는건데 깜빡했네.<pre><code class="language-java">for(String str : arr){
  answer += str;
}</code></pre>
</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120895/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120895/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] n의 배수 고르기]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-n%EC%9D%98-%EB%B0%B0%EC%88%98-%EA%B3%A0%EB%A5%B4%EA%B8%B0</link>
            <guid>https://velog.io/@hye-velog/CodingTest-n%EC%9D%98-%EB%B0%B0%EC%88%98-%EA%B3%A0%EB%A5%B4%EA%B8%B0</guid>
            <pubDate>Wed, 19 Apr 2023 00:37:51 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>정수 n과 정수 배열 numlist가 매개변수로 주어질 때, numlist에서 n의 배수가 아닌 수들을 제거한 배열을 return하도록 solution 함수를 완성해주세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ n ≤ 10,000</li>
<li>1 ≤ numlist의 크기 ≤ 100</li>
<li>1 ≤ numlist의 원소 ≤ 100,000</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>n</th>
<th>numlist</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>3</td>
<td>[4, 5, 6, 7, 8, 9, 10, 11, 12]</td>
<td>[6, 9, 12]</td>
</tr>
<tr>
<td>5</td>
<td>[1, 9, 3, 10, 13, 5]</td>
<td>[10, 5]</td>
</tr>
<tr>
<td>12</td>
<td>[2, 100, 120, 600, 12, 12]</td>
<td>[120, 600, 12, 12]</td>
</tr>
</tbody></table>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">import java.util.ArrayList;
class Solution {
    public int[] solution(int n, int[] numlist) {
        ArrayList&lt;Integer&gt; list = new ArrayList&lt;&gt;();

        for(int num : numlist){
            if(num % n == 0){
                list.add(num);
            }
        }

        int[] answer = new int[list.size()];

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

        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120905/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120905/solution_groups?language=java</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[CodingTest] 문자열 정렬하기 (1)]]></title>
            <link>https://velog.io/@hye-velog/CodingTest-%EB%AC%B8%EC%9E%90%EC%97%B4-%EC%A0%95%EB%A0%AC%ED%95%98%EA%B8%B0-1</link>
            <guid>https://velog.io/@hye-velog/CodingTest-%EB%AC%B8%EC%9E%90%EC%97%B4-%EC%A0%95%EB%A0%AC%ED%95%98%EA%B8%B0-1</guid>
            <pubDate>Tue, 18 Apr 2023 00:27:56 GMT</pubDate>
            <description><![CDATA[<h2 id="📖-exam">📖 Exam</h2>
<h4 id="문제-설명"><strong>문제 설명</strong></h4>
<p>문자열 my_string이 매개변수로 주어질 때, my_string 안에 있는 숫자만 골라 오름차순 정렬한 리스트를 return 하도록 solution 함수를 작성해보세요.</p>
<h4 id="제한-조건">제한 조건</h4>
<ul>
<li>1 ≤ my_string의 길이 ≤ 100</li>
<li>my_string에는 숫자가 한 개 이상 포함되어 있습니다.</li>
<li>my_string은 영어 소문자 또는 0부터 9까지의 숫자로 이루어져 있습니다.</li>
</ul>
<h4 id="입출력-예">입출력 예</h4>
<table>
<thead>
<tr>
<th>my_string</th>
<th>result</th>
</tr>
</thead>
<tbody><tr>
<td>&quot;hi12392&quot;</td>
<td>[1, 2, 2, 3, 9]</td>
</tr>
<tr>
<td>&quot;p2o4i8gj2&quot;</td>
<td>[2, 2, 4, 8]</td>
</tr>
<tr>
<td>&quot;abcde0&quot;</td>
<td>[0]</td>
</tr>
</tbody></table>
<ul>
<li><p>입출력 예 #1
&quot;hi12392&quot;에 있는 숫자 1, 2, 3, 9, 2를 오름차순 정렬한 [1, 2, 2, 3, 9]를 return 합니다.</p>
</li>
<li><p>입출력 예 #2
&quot;p2o4i8gj2&quot;에 있는 숫자 2, 4, 8, 2를 오름차순 정렬한 [2, 2, 4, 8]을 return 합니다.</p>
</li>
<li><p>입출력 예 #3
&quot;abcde0&quot;에 있는 숫자 0을 오름차순 정렬한 [0]을 return 합니다.</p>
</li>
</ul>
<hr>
<h2 id="✍-answer">✍ Answer</h2>
<pre><code class="language-java">import java.util.*;
class Solution {
    public int[] solution(String my_string) {
        ArrayList&lt;Integer&gt; list = new ArrayList&lt;&gt;();
        for(char ch : my_string.toCharArray()){
            if(48 &lt;= ch &amp;&amp; ch &lt;= 57){
                // list.add(ch-&#39;0&#39;);
                list.add(Character.getNumericValue(ch));
            }
        }
        int[] answer = new int[list.size()];
        int size = 0;
        for(int i : list){
          answer[size++] = i;
        }
        Arrays.sort(answer);
        return answer;
    }
}</code></pre>
<hr>
<h2 id="💡-realization">💡 Realization</h2>
<ul>
<li><p>숫자만 추출하는 방법도 있었네. 이렇게 했으면 훨씬 간편하게 작성 가능했었다.</p>
<pre><code class="language-java">my_string.replaceAll(&quot;[a-z]&quot;,&quot;&quot;);</code></pre>
</li>
<li><p>스트림...</p>
<pre><code class="language-java">import java.util.*;
class Solution {
  public int[] solution(String myString) {
      return Arrays.stream(myString.replaceAll(&quot;[A-Z|a-z]&quot;, &quot;&quot;).split(&quot;&quot;)).sorted().mapToInt(Integer::parseInt).toArray();
  }
}</code></pre>
</li>
</ul>
<p>참고사이트: <a href="https://school.programmers.co.kr/learn/courses/30/lessons/120850/solution_groups?language=java">https://school.programmers.co.kr/learn/courses/30/lessons/120850/solution_groups?language=java</a></p>
]]></description>
        </item>
    </channel>
</rss>