<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>yongchan_312.log</title>
        <link>https://velog.io/</link>
        <description>안녕하세요. 클래식을 즐기는 개발자, 이용찬입니다.</description>
        <lastBuildDate>Tue, 18 Jan 2022 00:03:20 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>yongchan_312.log</title>
            <url>https://images.velog.io/images/yongchan_0312/profile/21d7f172-6f26-4553-8d9a-4c63e97f744f/피에타.jpg</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. yongchan_312.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/yongchan_0312" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 3진법 뒤집기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-3%EC%A7%84%EB%B2%95-%EB%92%A4%EC%A7%91%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-3%EC%A7%84%EB%B2%95-%EB%92%A4%EC%A7%91%EA%B8%B0</guid>
            <pubDate>Tue, 18 Jan 2022 00:03:20 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/68935">(프로그래머스) 3진법 뒤집기</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">def solution(n):
    numList = []
    while n != 0:
        numList.append(n % 3)
        n //= 3

    n = len(numList)
    sumNum = 0
    for i in range(n - 1, -1, -1):
        sumNum += numList[i] * (3 ** ((n - 1) - i))

    return sumNum</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 로또의 최고 순위와 최저 순위]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%A1%9C%EB%98%90%EC%9D%98-%EC%B5%9C%EA%B3%A0-%EC%88%9C%EC%9C%84%EC%99%80-%EC%B5%9C%EC%A0%80-%EC%88%9C%EC%9C%84</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%A1%9C%EB%98%90%EC%9D%98-%EC%B5%9C%EA%B3%A0-%EC%88%9C%EC%9C%84%EC%99%80-%EC%B5%9C%EC%A0%80-%EC%88%9C%EC%9C%84</guid>
            <pubDate>Mon, 17 Jan 2022 08:37:17 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/77484?language=python3">(프로그래머스) 로또의 최고 순위와 최저 순위</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">def counter(data):
    if data == 1 or data == 0:
        return 6
    else:
        return 7 - data


def solution(lottos, win_nums):
    result = []
    answer = [j for i in win_nums for j in lottos if i == j]

    DownCnt = len(answer)
    zeroCnt = lottos.count(0)
    UpCnt = DownCnt + zeroCnt

    result = [counter(UpCnt), counter(DownCnt)]
    return result</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 가운데 글자 가져오기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EA%B0%80%EC%9A%B4%EB%8D%B0-%EA%B8%80%EC%9E%90-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EA%B0%80%EC%9A%B4%EB%8D%B0-%EA%B8%80%EC%9E%90-%EA%B0%80%EC%A0%B8%EC%98%A4%EA%B8%B0</guid>
            <pubDate>Thu, 13 Jan 2022 00:17:26 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12903">(프로그래머스) 가운데 글자 가져오기</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public String solution(String s) {
        String answer = &quot;&quot;;
//         int num = s.length();

//         if(num % 2 == 0) {
//             for(int i = (num / 2) - 1; i &lt; (num / 2) + 1; i++) {
//                 answer += s.substring(i, i + 1);
//             }
//         } else {
//             for(int i = (num / 2); i &lt; (num / 2) + 1; i++) {
//                 answer += s.substring(i, i + 1);
//             }
//         }
//         return answer;
        int n = s.length();
        return s.substring((n - 1) / 2, (n / 2) + 1);
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 문자열 내p와 y의 개수]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%82%B4p%EC%99%80-y%EC%9D%98-%EA%B0%9C%EC%88%98</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%82%B4p%EC%99%80-y%EC%9D%98-%EA%B0%9C%EC%88%98</guid>
            <pubDate>Wed, 12 Jan 2022 06:27:06 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12916?language=java">(프로그래머스) 문자열 내 p와 y의 개수</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    boolean solution(String s) {
        boolean answer = true;
        int nump = 0;
        int numy = 0;
        char temp;

        for(int i = 0; i &lt; s.length(); i++) {
            temp = s.charAt(i);
            if(temp == &#39;p&#39; || temp == &#39;P&#39;) {
                nump++;
            }
            if(temp == &#39;y&#39; || temp == &#39;Y&#39;) {
                numy++;
            }            
        }

        if(nump == numy) {
            answer = true;
        } else {
            answer = false;
        }

        return answer;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 문자열 다루기 기본]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%8B%A4%EB%A3%A8%EA%B8%B0-%EA%B8%B0%EB%B3%B8</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%AC%B8%EC%9E%90%EC%97%B4-%EB%8B%A4%EB%A3%A8%EA%B8%B0-%EA%B8%B0%EB%B3%B8</guid>
            <pubDate>Wed, 12 Jan 2022 05:13:13 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12918">(프로그래머스) 문자열 다루기 기본</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public boolean solution(String s) {
        boolean answer = true;
        char temp;

        for(int i = 0; i &lt; s.length(); i++) {
            temp = s.charAt(i);

            if(!(s.length() == 4 || s.length() == 6)) {
                answer = false;
            }
            if(!(&#39;0&#39; &lt;= temp &amp;&amp; temp &lt;= &#39;9&#39;)) {
                answer = false;
            }
        }

        return answer;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 제일 작은 수 제거하기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%A0%9C%EC%9D%BC-%EC%9E%91%EC%9D%80-%EC%88%98-%EC%A0%9C%EA%B1%B0%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%A0%9C%EC%9D%BC-%EC%9E%91%EC%9D%80-%EC%88%98-%EC%A0%9C%EA%B1%B0%ED%95%98%EA%B8%B0</guid>
            <pubDate>Tue, 11 Jan 2022 23:41:56 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12935">(프로그래머스) 제일 작은 수 제거하기</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public int[] solution(int[] arr) {
        int[] answer = new int[arr.length - 1];
        int temp = arr[0];

        for(int i = 0; i &lt; arr.length; i++) {
            if(temp &gt; arr[i]) {
                temp = arr[i];
            }
        }

        int k = 0;
        for(int i = 0; i &lt; arr.length; i++) {
            if(temp &lt; arr[i]) {
                answer[k] = arr[i];
                k++;
            }
        }
        return answer;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 자연수 뒤집어 배열로 만들기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9E%90%EC%97%B0%EC%88%98-%EB%92%A4%EC%A7%91%EC%96%B4-%EB%B0%B0%EC%97%B4%EB%A1%9C-%EB%A7%8C%EB%93%A4%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9E%90%EC%97%B0%EC%88%98-%EB%92%A4%EC%A7%91%EC%96%B4-%EB%B0%B0%EC%97%B4%EB%A1%9C-%EB%A7%8C%EB%93%A4%EA%B8%B0</guid>
            <pubDate>Tue, 11 Jan 2022 13:54:17 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12932">(프로그래머스) 자연수 뒤집어 배열로 만들기</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public long[] solution(long n) {
        long m = n;
        int temp = 0;

        while(n != 0) {
            n /= 10;
            temp++;
        }
        long[] answer = new long[temp];

        for(int i = 0; i &lt; temp; i++) {
            answer[i] = m % 10;
            m /= 10;
        }
        return answer;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 콜라츠 추측]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%BD%9C%EB%9D%BC%EC%B8%A0-%EC%B6%94%EC%B8%A1</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%BD%9C%EB%9D%BC%EC%B8%A0-%EC%B6%94%EC%B8%A1</guid>
            <pubDate>Tue, 11 Jan 2022 13:50:41 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12943">(프로그래머스) 콜라츠 추측</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public int solution(int num) {
        long temp = num;
        int answer = 0;

        while(temp != 1) {
            if(temp % 2 == 0) {
                temp /= 2;
            } 
            else {
                temp = (temp * 3) + 1;
            }
            answer++;

            if(answer == 500) {
                return -1;
            }
        }
        return answer;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 부족한 금액 계산하기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%B6%80%EC%A1%B1%ED%95%9C-%EA%B8%88%EC%95%A1-%EA%B3%84%EC%82%B0%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%B6%80%EC%A1%B1%ED%95%9C-%EA%B8%88%EC%95%A1-%EA%B3%84%EC%82%B0%ED%95%98%EA%B8%B0</guid>
            <pubDate>Fri, 07 Jan 2022 17:28:33 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/82612">(프로그래머스) 부족한 금액 계산하기</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public long solution(int price, int money, int count) {
        long num = 0;

        for (int i = 1; i &lt;= count; i++) {
            num += price * i;
        }

        if (num - money &gt; 0) {
            return num - money;
        } else {
            return 0;
        }
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 약수의 개수와 덧셈]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%95%BD%EC%88%98%EC%9D%98-%EA%B0%9C%EC%88%98%EC%99%80-%EB%8D%A7%EC%85%88</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%95%BD%EC%88%98%EC%9D%98-%EA%B0%9C%EC%88%98%EC%99%80-%EB%8D%A7%EC%85%88</guid>
            <pubDate>Wed, 05 Jan 2022 15:27:27 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/77884">(프로그래머스) 약수의 개수와 덧셈</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public int solution(int left, int right) {
        int result = 0;

        for (int i = left; i &lt;= right; i++) {
            int count = 0;

            for (int j = 1; j &lt;= i; j++) {
                if (i % j == 0) {
                    count++;
                }
            }

            if (count % 2 == 0) {
                result += i;
            } else {
                result -= i;
            }
        }

        return result;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[열혈자바] 배열]]></title>
            <link>https://velog.io/@yongchan_0312/%EB%B0%B0%EC%97%B4</link>
            <guid>https://velog.io/@yongchan_0312/%EB%B0%B0%EC%97%B4</guid>
            <pubDate>Wed, 05 Jan 2022 13:38:35 GMT</pubDate>
            <description><![CDATA[<h2 id="배열">배열</h2>
<hr>
<p>타입이 같은 둘 이상의 데이터를 저장할 수 있는 메모리 공간
<img src="https://images.velog.io/images/yongchan_0312/post/183dee9a-a651-4175-b80d-1c16f1ded21b/image.png" alt=""></p>
<h2 id="배열-초기화">배열 초기화</h2>
<hr>
<p>배열 생성 시 모든 요소는 <code>0</code> 또는 <code>null</code>로 초기화</p>
<pre><code class="language-java">int[] arr =new int[] {1, 2, 3};
int[] arr = {1, 2, 3};</code></pre>
<blockquote>
</blockquote>
<p><strong>for each문</strong>
: 배열의 길이와 요소에 신경 쓸 필요가 없는 장점</p>
<pre><code class="language-java">// 기존 for문
int[] arr = {1, 2, 3};
for (int i = 0; i &lt; arr.length; i++) {
    System.out.println(arr[i]);
}

// for each문
int[] arr = {1, 2, 3};
for (int newarr : arr) {
    System.out.println(newarr);
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 완주하지 못한 선수]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%99%84%EC%A3%BC%ED%95%98%EC%A7%80-%EB%AA%BB%ED%95%9C-%EC%84%A0%EC%88%98</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%99%84%EC%A3%BC%ED%95%98%EC%A7%80-%EB%AA%BB%ED%95%9C-%EC%84%A0%EC%88%98</guid>
            <pubDate>Wed, 05 Jan 2022 08:08:27 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/42576?language=java">(프로그래머스) 완주하지 못한 선수</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">import java.util.*;

class Solution {
    public String solution(String[] participant, String[] completion) {
        String result = &quot;&quot;;
        Arrays.sort(participant);
        Arrays.sort(completion);

        for(int i = 0; i &lt; completion.length; i++) {
            if(!(participant[i].equals(completion[i]))) {
                result += participant[i];

                return result;
            }
        }

        result += participant[participant.length - 1];

        return result;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 내적]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%82%B4%EC%A0%81</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EB%82%B4%EC%A0%81</guid>
            <pubDate>Tue, 04 Jan 2022 11:12:16 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/70128">(프로그래머스) 내적</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public int solution(int[] a, int[] b) {
        int result = 0;

        for(int i = 0; i &lt; a.length; i++) {
            result += a[i] * b[i];
        }

        return result;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 음양 더하기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9D%8C%EC%96%91-%EB%8D%94%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9D%8C%EC%96%91-%EB%8D%94%ED%95%98%EA%B8%B0</guid>
            <pubDate>Mon, 03 Jan 2022 10:13:28 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/76501?language=java">(프로그래머스) 음양 더하기</a></p>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public int solution(int[] absolutes, boolean[] signs) {
        int result = 0;

        for (int i = 0; i &lt; signs.length; i++) {
            result += absolutes[i] * (signs[i]? 1 : -1);
        }

        return result;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 예산]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%98%88%EC%82%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%98%88%EC%82%B0</guid>
            <pubDate>Sat, 01 Jan 2022 11:50:18 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12982">(프로그래머스) 예산</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">def solution(d, budget):
    s = sorted(d)
    temp = []

    for i in range(len(s)):
        if sum(temp) &lt; budget:
            temp.append(s[i])

    if sum(temp) &gt; budget:
        temp = temp[:-1]

    return len(temp)</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 이상한 문자 만들기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9D%B4%EC%83%81%ED%95%9C-%EB%AC%B8%EC%9E%90-%EB%A7%8C%EB%93%A4%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%9D%B4%EC%83%81%ED%95%9C-%EB%AC%B8%EC%9E%90-%EB%A7%8C%EB%93%A4%EA%B8%B0</guid>
            <pubDate>Sat, 01 Jan 2022 11:48:09 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12930">(프로그래머스) 이상한 문자 만들기</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">def solution(data):
    li = data.split(&#39; &#39;)
    result = &#39;&#39;

    for i in li:
        txt = &#39;&#39;
        for j in range(len(i)):
            if j % 2 == 0:
                txt += i[j].upper()
            if j % 2 == 1:
                txt += i[j].lower()

        result += (txt + &#39; &#39;)

    return result[:-1]</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 하샤드 수]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%95%98%EC%83%A4%EB%93%9C-%EC%88%98</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%95%98%EC%83%A4%EB%93%9C-%EC%88%98</guid>
            <pubDate>Sat, 01 Jan 2022 11:46:10 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12947">(프로그래머스) 하샤드 수</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">def solution(x):
    nums = list(map(int, str(x)))

    if x % sum(nums) == 0:
        return True

    return False</code></pre>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public boolean solution(int x) {
        boolean result = false;
        int num = x;
        int sum = 0;

        while (num &gt;= 1) {
            sum += num % 10;
            num /= 10;
        }

        if (x % sum == 0) {
            result = true;
        } 

        return result;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[열혈자바] 생성자]]></title>
            <link>https://velog.io/@yongchan_0312/%EC%83%9D%EC%84%B1%EC%9E%90</link>
            <guid>https://velog.io/@yongchan_0312/%EC%83%9D%EC%84%B1%EC%9E%90</guid>
            <pubDate>Thu, 30 Dec 2021 18:09:31 GMT</pubDate>
            <description><![CDATA[<h2 id="생성자">생성자</h2>
<hr>
<ul>
<li>인스턴스가 생성될 때마다 호출되는 <code>&#39;인스턴스 초기화 메서드&#39;</code></li>
<li>모든 클래스에는 반드시 하나 이상의 생성자가 필요</li>
</ul>
<p><strong>인스턴스 초기화</strong>
: 인스턴스 변수에 적절한 값을 저장</p>
<pre><code class="language-java">class Tv() {
    Tv box = new Tv();
}

// 연산자 new에 의해서 메모리(heap)에 Tv클래스의 인스턴스 생성
// 생성자 Tv()가 호출되어 수행
// 연산자 new의 결과로 생성된 Tv인스턴스의 주소가 반환되어 참조변수 box에 저장</code></pre>
<h2 id="생성자-this">생성자 this()</h2>
<hr>
<p>: 같은 클래스의 다른 생성자를 호출할 때 사용
(첫 줄에서만 사용가능)</p>
<pre><code class="language-java">class Tv {
    String color;
    int channel;

    Tv() {
        this(&quot;white&quot;, 3);
    }

    Tv(String color, int channel) {
        this.color = color;
        this.channel = channel;
    }
}</code></pre>
<blockquote>
</blockquote>
<p><strong>참조변수 this.</strong>
: 인스턴스 자신을 가르키는 참조변수, 인스턴스의 주소가 저장
(지역변수와 인스턴스 변수를 구별할 때 사용)</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 소수 만들기]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%86%8C%EC%88%98-%EB%A7%8C%EB%93%A4%EA%B8%B0</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%86%8C%EC%88%98-%EB%A7%8C%EB%93%A4%EA%B8%B0</guid>
            <pubDate>Wed, 29 Dec 2021 08:46:32 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/12977">(프로그래머스) 소수 만들기</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">from itertools import combinations

def prime(data):
    for j in range(2, int(data ** 0.5) + 1):
        if data % j == 0:
            return False

    return True

def solution(nums):
    com = list(combinations(nums, 3))
    result = 0

    for i in com:
        if prime(sum(i)):
            result += 1

    return result</code></pre>
<p><strong>Java 풀이</strong></p>
<pre><code class="language-java">class Solution {
    public int solution(int[] nums) {
        int count = 0;

        for (int i = 0; i &lt; nums.length; i++) {
            for (int j = i + 1; j &lt; nums.length; j++) {
                for (int k = j + 1; k &lt; nums.length; k++) {
                    if (Prime(nums[i] + nums[j] + nums[k])) {
                        count++;
                    }
                }
            }
        }

        return count;
    }

    public static boolean Prime(int data) {
        boolean result = true;

        for (int i = 2; i &lt; data; i++) {
            if (data % i == 0) {
                result = false;
                break;
            }
        }

        return result;
    }
}</code></pre>
]]></description>
        </item>
        <item>
            <title><![CDATA[[알고리즘] (프로그래머스) 폰켓몬]]></title>
            <link>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%8F%B0%EC%BC%93%EB%AA%AC</link>
            <guid>https://velog.io/@yongchan_0312/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%ED%8F%B0%EC%BC%93%EB%AA%AC</guid>
            <pubDate>Wed, 29 Dec 2021 08:43:58 GMT</pubDate>
            <description><![CDATA[<p><strong>문제</strong>
<a href="https://programmers.co.kr/learn/courses/30/lessons/1845">(프로그래머스) 폰켓몬</a></p>
<p><strong>Python 풀이</strong></p>
<pre><code class="language-python">def solution(nums):
    return int(min(len(nums)/2, len(set(nums))))</code></pre>
]]></description>
        </item>
    </channel>
</rss>