<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>dev____123.log</title>
        <link>https://velog.io/</link>
        <description>🐥</description>
        <lastBuildDate>Sun, 04 Jun 2023 18:11:27 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>dev____123.log</title>
            <url>https://images.velog.io/images/dev____123/profile/4537b046-5d3b-4e11-8923-e0476ec6fd52/social.png</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. dev____123.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/dev____123" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[주식가격]]></title>
            <link>https://velog.io/@dev____123/%EC%A3%BC%EC%8B%9D%EA%B0%80%EA%B2%A9</link>
            <guid>https://velog.io/@dev____123/%EC%A3%BC%EC%8B%9D%EA%B0%80%EA%B2%A9</guid>
            <pubDate>Sun, 04 Jun 2023 18:11:27 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/42584">출처: 프로그래머스 코딩 테스트 연습</a></p>
<blockquote>
<p>시도했던 틀린 답 </p>
</blockquote>
<pre><code>def solution(prices):
    stack = []
    n = len(prices)
    answer = [0]*n
    for i in range(n):
          while stack :
            j = stack.pop()
               if prices[i] &gt;= prices[j]:
                  answer[j] += 1
            else:
                  if prices[j] != 10001:
                        answer[j] += 1
                    prices[j] = 10001     
      stack = [j for j in range(i+1)]</code></pre><p>우선 시간 상관없이 답이 나오도록 짜보았다
i가 0일 경우 stack에 0을 넣음
그 뒤로는 stack에 prices[i]보다 앞에 있는 원소들을 모두 넣은 뒤 하나씩 꺼내어서 prices[i]와 비교하여 만약 prices[i]가 크다면 answer에 1씩 더하고 stack 원소가 클 경우, answer에 1을 더하고 다음 prices 원소들과 비교할 수 없도록 stack 원소가 최대값인 10000보다 큰 수로 바꾼다. 
prices 배열 값 변경, for문으로 stack 배열을 만드니깐 시간초과가 나왔다. stack 배열을 따로 만들지 않고 prices배열만을 사용하여 풀 수 있도록 해봄</p>
<hr>
</br>

<pre><code>from collections import deque 
def solution(prices):
    prices = deque(prices)
    n = 0
    answer = [0]*l
    while prices:
        price = prices.popleft()
        if not prices : break
        for i in prices:
            if i &gt;= price :
                answer[n] += 1
            else : 
                answer[n]+=1
                break
        print(answer)
        n+=1       
    return answer</code></pre><blockquote>
<p>price의 가장 왼쪽 원소를 popleft()로 삭제하고 while문으로 뒤에 원소들과 하나씩 비교하여 만약 같거나 작다면 answer에 1을 더하고 크다면 break로 while문을 벗어나도록 함</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[뒤에 있는 큰 수 찾기]]></title>
            <link>https://velog.io/@dev____123/%EB%92%A4%EC%97%90-%EC%9E%88%EB%8A%94-%ED%81%B0-%EC%88%98-%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@dev____123/%EB%92%A4%EC%97%90-%EC%9E%88%EB%8A%94-%ED%81%B0-%EC%88%98-%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Sat, 03 Jun 2023 18:52:04 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/154539">출처: 프로그래머스 코딩 테스트 연습</a></p>
<pre><code>def solution(numbers):
    answer = [-1]*len(numbers)
    stack = []
    for i in range(len(numbers)):
        while stack and numbers[stack[-1]] &lt; numbers[i]:
            answer[stack.pop()] = numbers[i]
        stack.append(i)      
    return answer</code></pre><blockquote>
<p>처음엔 아무생각없이 2중 for문으로 돌리니깐 시간복잡도가 무지막지하게 커져서 시간초과가 나옴
힌트보고 스택사용해서 겨우 풀었다.</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[멀리 뛰기]]></title>
            <link>https://velog.io/@dev____123/%EB%A9%80%EB%A6%AC-%EB%9B%B0%EA%B8%B0</link>
            <guid>https://velog.io/@dev____123/%EB%A9%80%EB%A6%AC-%EB%9B%B0%EA%B8%B0</guid>
            <pubDate>Sun, 28 May 2023 11:09:03 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/12914">출처: 프로그래머스 코딩 테스트 연습</a></p>
<pre><code>def solution(n):
    if n == 1 or n == 2 :
        return n
    data = [1,2]
    for i in range(2,n):
        data.append(data[i-1]+data[i-2])

    return data[-1]%1234567</code></pre><blockquote>
<p>재귀적으로 푸는데 계속 시간초과가 나오길래 다른 풀이방법을 찾아보니 피보나치 수를 구하는거였음 바로 답이 나오길래 허무했다
정말 문제패턴 찾는게 중요하구나 느낌</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[올바른 괄호]]></title>
            <link>https://velog.io/@dev____123/%EC%98%AC%EB%B0%94%EB%A5%B8-%EA%B4%84%ED%98%B8</link>
            <guid>https://velog.io/@dev____123/%EC%98%AC%EB%B0%94%EB%A5%B8-%EA%B4%84%ED%98%B8</guid>
            <pubDate>Sat, 27 May 2023 13:40:37 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/12909">출처: 프로그래머스 코딩 테스트 연습</a></p>
<pre><code>def solution(s):   
    data = []

    for i in s :
        if i == &#39;)&#39; and data:
            data.pop()
        else : data.append(i)

    return True if not data else False</code></pre><p>스택으로 구현
자꾸 런타임에러가 나길래 한참 고민했는데 스택이 빈 경우를 체크하지 않아서 생기는 에러였다.😞</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[튜플]]></title>
            <link>https://velog.io/@dev____123/%ED%8A%9C%ED%94%8C</link>
            <guid>https://velog.io/@dev____123/%ED%8A%9C%ED%94%8C</guid>
            <pubDate>Fri, 26 May 2023 18:20:45 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/64065">출처: 프로그래머스 코딩 테스트 연습, </a></p>
<pre><code>def solution(s):
    s = s[2:-2].split(&#39;},{&#39;)
    data = []

    for i in s:
        n = list(map(int, i.split(&#39;,&#39;)))
        data.append(sum(n))

    data.sort()

    return  [ data[i] if i == 0 else data[i]-data[i-1]  for i in range(len(data)) ]</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[나누어 떨어지는 숫자 배열]]></title>
            <link>https://velog.io/@dev____123/%EB%82%98%EB%88%84%EC%96%B4-%EB%96%A8%EC%96%B4%EC%A7%80%EB%8A%94-%EC%88%AB%EC%9E%90-%EB%B0%B0%EC%97%B4</link>
            <guid>https://velog.io/@dev____123/%EB%82%98%EB%88%84%EC%96%B4-%EB%96%A8%EC%96%B4%EC%A7%80%EB%8A%94-%EC%88%AB%EC%9E%90-%EB%B0%B0%EC%97%B4</guid>
            <pubDate>Fri, 26 May 2023 11:31:02 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/12910">출처: 프로그래머스 코딩 테스트 연습</a></p>
<pre><code>def solution(arr, divisor):
    answer = [i for i in arr if i % divisor == 0]
    return [-1] if len(answer) == 0 else sorted(answer)</code></pre><p>리스트 표현식을 얼마나 잘 쓸 수 있는지가 중요한 듯</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[Programmers] 달리기 경주]]></title>
            <link>https://velog.io/@dev____123/Programmers-%EB%8B%AC%EB%A6%AC%EA%B8%B0-%EA%B2%BD%EC%A3%BC</link>
            <guid>https://velog.io/@dev____123/Programmers-%EB%8B%AC%EB%A6%AC%EA%B8%B0-%EA%B2%BD%EC%A3%BC</guid>
            <pubDate>Wed, 24 May 2023 17:55:51 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/178871">문제 링크</a></p>
<p><code>Lv1</code></p>
<pre><code>def solution(players, callings):
    l = 0
    name = &#39;&#39;
    dic1 = {}
    dic2 = dict()

    for i in range(len(players)):
        dic1[i] = players[i]
        dic2[players[i]] = i


    for i in callings :
        l = dic2[i] # i 위치가져오기
        name = dic1[l-1]
        dic1[l-1], dic1[l] = dic1[l],dic1[l-1]
        dic2[i],dic2[name] = dic2[name], dic2[i]


    answer = list(dic1.values())
    return answer</code></pre><blockquote>
<p>lv1이길래 쉽게 swap 사용해서 풀었더니 시간초과가 나왔다.
최대길이가 callings가 1,000,000 players가 50,000 이기 때문에 시간 복잡도를 중요하게 생각하고 풀어야했다.
index함수를 for문이랑 함께 썼더니 시간복잡도가 O(NM)으로 엄청 커져버렸다.
힌트들을 보니 딕셔너리 사용을 해야한다고 해서 어찌저찌 풀어봄
시간복잡도 다시 공부해야지...</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[JavaScript]]></title>
            <link>https://velog.io/@dev____123/JavaScript</link>
            <guid>https://velog.io/@dev____123/JavaScript</guid>
            <pubDate>Tue, 23 May 2023 14:39:26 GMT</pubDate>
            <description><![CDATA[<h1 id="📁javascript-란"><strong>📁JavaScript 란?</strong></h1>
<p>객체 기반의 스크립트 프로그래밍 언어</p>
<p>웹사이트상에서 동적 상호작용성을 제공할 수 있는 완전한 동적 프로그래밍 언어</p>
<p>비동기 처리</p>
<blockquote>
<p>동기(Synchronous) :  모든 작업이 동시에 일어난다. 요청과 결과가 동시에 일어남<br>비동기(Asynchronous) : 하나의 작업이 끝날 때까지 다른 작업은 기다린다. 요청과 결과가 동시에 일어나지 않음</p>
</blockquote>
<p><strong>사용방법</strong>
<code>&lt;script src=&quot;js파일위치/js파일명&quot;&gt;&lt;/script&gt;</code>
</br>
</br></p>
<hr>
<h2 id="📑-변수-선언"><strong>📑 변수 선언</strong> </h2>
</br>

<h3 id="1-var"> 1. var</h3>
<blockquote>
<p><strong>전역 범위 또는 함수 범위로 지정된다. 즉 함수 밖에서 선언되면 전역 변수, 함수 내에서 선언되면 지역변수</strong><br><strong>변수 선언과 동시에 초기화가 이루어짐</strong><br><strong>변수의 중복 선언, 재할당이 가능</strong></p>
</blockquote>
<p><strong>👉 선언 방법</strong></p>
<pre><code>/* 선언 후 초기화 */
var n;
n = 123

/* 선언과 초기화 같이 */
var n = 123

/* 여러 변수를 한번에 선언 */
var n= 123, m = 456, 7 = &#39;js]</code></pre><p><strong>👉 중복선언</strong></p>
<pre><code>var n = &#39;hello&#39;
var n = &#39;hi&#39;</code></pre><p><strong>👉 재할당</strong></p>
<pre><code>var n  = &#39;hello&#39;
n = &#39;hi&#39;</code></pre></br>
</br>

<h3 id="2-let">2. let</h3>
<blockquote>
<p>변수가 선언된 블록 내에서만 사용 가능<br>재할당만 가능, 중복선언은 X <br>각각 다른 범위에서 중복선언은 가능</p>
</blockquote>
<p><strong>👉 선언 방법</strong></p>
<pre><code>/* 선언 후 초기화 */
let n;
n = 123

/* 선언과 초기화 같이 */
let n = 123

/* 여러 변수를 한번에 선언 및 초기화 */
let n= 123, m = 456, 7 = &#39;js]</code></pre><p><strong>👉 재할당, 중복선언</strong></p>
<pre><code>/* 재할당 가능 */
let n =&#39;1234&#39;
n = &#39;567&#39;

/* 중복 선언 불가 */
let n = &#39;hello&#39;
// let n = &#39;hi&#39;  불가능 
if(true){
    let n = &#39;hi&#39;  //다른 범위이므로 선언 가능
    }</code></pre></br>
</br>

<h3 id="3-const">3. const</h3>
<p>** ▪ 상수 ( 변하지 않는 값)**</p>
<p><strong>재할당</strong>과 <strong>중복선언</strong>이 불가능하다.</p>
<pre><code>const n = &#39;12345&#39;
// const n = &#39;67890&#39; 중복선언x
// n = &#39;1123123&#39; 재할당 x</code></pre><p>👉 배열, 객체의 경우 주소값을 할당받기 때문에 요소나 속성의 추가가 가능하다.
</br></br></p>
<h3 id="변수가-가질-수-있는-자료형----문자열-숫자-boolean-배열-객체"><strong>변수가 가질 수 있는 자료형  :</strong>  문자열, 숫자, Boolean, 배열, 객체</h3>
</br>

<hr>
</br>

<h2 id="📑-주석"><strong>📑 주석</strong> </h2>
</br>

<table>
  <tr>
    <td>/* ... */</td>
    <td> 블럭 주석. 여러 줄을 주석 처리함</td>  
  </tr>
   <tr>
    <td>//</td>
    <td>한 줄 주석</td>  
  </tr>
</table>


<pre><code>// 이 줄만 주석처리

/* 여기부터
   ~~~
   여기까지 
   주석처리 */</code></pre></br>

<hr>
</br>

<h2 id="📑-연산자"><strong>📑 연산자</strong></h2>
</br>

<h4 id="👉-문자열-연산자-"><strong>👉 문자열 연산자</strong> + </h4>
<p>문자열을 연결한다.</p>
<blockquote>
<p>1) 문자열 + 문자열
var n = &#39;hi&#39;;
var m = &#39;hello&#39;;
hihello
2) 문자열 + 숫자
var n = &#39;hi&#39;+9;
hi9</p>
</blockquote>
<h4 id="-👉-산술-연산자">** 👉 산술 연산자** </h4>
<p><code>+</code> 더하기</p>
<p><code>-</code> 빼기</p>
<p><code>*</code> 곱하기</p>
<p><code>/</code> 나누기</p>
<p><code>%</code> 나머지</p>
<p><code>**</code> :  거듭제곱</p>
</br>


<h4 id="-👉-증감연산자-">** 👉 증감연산자 **</h4>
<p><code>++</code> :  1증가</p>
<p><code>--</code>   : 1감소
</br></p>
<h4 id="👉-대입연산자--">*<em>👉 대입연산자 <code>=</code> *</em></h4>
<p>let n =  &#39;hi&#39;;
</br></p>
<h4 id="👉-비교-연산자"><strong>👉 비교 연산자</strong></h4>
<table>
<thead>
<tr>
<th><strong>비교 연산자</strong></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td><code>==</code> 동등 비교</td>
<td>피연산자가 서로 같으면 True 반환</td>
</tr>
<tr>
<td>!=  부등 비교</td>
<td>피연산자가 서로 다르면 True 반환</td>
</tr>
<tr>
<td>A  &gt; B</td>
<td>A가 B보다 클 경우 True 반환</td>
</tr>
<tr>
<td>A &gt;= B</td>
<td>A가 B보다 크거나 같을 경우  True 반환</td>
</tr>
<tr>
<td>A &lt;= B</td>
<td>B가 A보다 크거나 같을 경우 True 반환</td>
</tr>
<tr>
<td>A  &lt;  B</td>
<td>B가 A보다 클 경우 True 반환</td>
</tr>
<tr>
<td><code>===</code> 일치</td>
<td>피연산자의 값과 타입이 같으면 true 반환</td>
</tr>
<tr>
<td>!== 불일치</td>
<td>피연산자의 값 또는 타입이 다르면 true 반환</td>
</tr>
<tr>
<td></br></td>
<td></td>
</tr>
</tbody></table>
<h4 id="👉-논리-연산자"><strong>👉 논리 연산자</strong></h4>
<table>
<thead>
<tr>
<th>논리 연산자</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>&amp;&amp;</td>
<td>둘다 참일 경우 true, 하나라도 거짓이면 false 반환</td>
</tr>
<tr>
<td>||</td>
<td>둘 중 하나만 참이면 true 반환, 그 외에는 모두 false</td>
</tr>
<tr>
<td>!(피연산자)</td>
<td>참이면 false, 거짓이면 true 로 반환</td>
</tr>
<tr>
<td></br></td>
<td></td>
</tr>
</tbody></table>
<p><strong>👉 삼항 연산자</strong></p>
<blockquote>
<p>(조건식)? 참일 경우 반환할 값  : 그 외 반환할 값</p>
</blockquote>
<pre><code>ex)
var n = 1;
(n &gt; 2 )? console.log(&#39;2보다 크다&#39;):console.log(&#39;2보다 작다&#39;)
&gt; 2보다 작다</code></pre><hr>
<h2 id="📑-제어문"><strong>📑 제어문</strong></h2>
</br>
</br>


<h3 id="👉조건문"><strong>👉조건문</strong></h3>
<h4 id="◼-if문"><strong>◼ if문</strong></h4>
<pre><code>
 if(조건식){  
 조건식이 참일 경우 수행할 실행문  
 }</code></pre><h4 id="▪-if--else문"><strong>▪ if ~ else문</strong></h4>
<pre><code> if(조건식){  
 조건식이 참일 경우 수행할 코드  
 }else{  
 조건식이 거짓일 경우 수행할 코드  
 }

 if(조건식1){  
  조건식1이 참일 경우 수행할 코드  
 }else if(조건식2){  
 조건식1이 거짓이고 조건식2이 참일 경우 수행할 코드  
 }else{  
    조건문이 거짓일 경우 수행할 코드  
 }</code></pre><h4 id="◼-switch문"><strong>◼ switch문</strong></h4>
<pre><code> switch(변수){  
     case 1 :  
         변수의 값이 1일 때 실행되는 코드  
     break;  
     case 2 :  
         변수의 값이 2일 때 실행되는 코드  
     break;  
     case 3 :  
         변수의 값이 3일 때 실행되는 코드  
     break;  
     deafult :  
          해당하는 case가 없을 경우 실행되는 코드  
     break;</code></pre></br>
</br>

<h3 id="👉-반복문"><strong>👉 반복문</strong></h3>
<h4 id="-◻-for문">** ◻ for문**</h4>
<pre><code> for(초기식;  조건식; 증감식 ){  
    조건식이 참일 경우 실행되는 코드  
 }

 ---

 ex) 1부터 10까지 출력하는 for문  
 for( var i = 1 ; i &lt; 11 ; i++){  
     console.log(i)  
 }</code></pre><h4 id="◻-while문"><strong>◻ while문</strong></h4>
<pre><code> while(조건식){  
 조건식이 참일 경우 실행되는 코드  
 }  

 ---

 ex) 1부터 10까지 출력하는 while문  
 var n = 1;  
 while(n &lt;11){  
    console.log(n);  
    n++;  
    }</code></pre><h4 id="◻-dowhile문"><strong>◻ do~while문</strong></h4>
<pre><code> do{  
 실행할 코드  
 }while(조건식)</code></pre><blockquote>
<p>👀 while문과 do~while문의 차이?
while문은 조건식 참이면 실행하지만</br>
do while은  실행문이 조건식보다 앞에 위치하기 때문에 
조건식이 거짓이라도 무조건 1번은 실행함</p>
</blockquote>
<h4 id="◻-for-in문">◻ for in문</h4>
<pre><code>for(변수 in 객체){

}
</code></pre><h4 id="◻-for-of문">◻ for of문</h4>
<pre><code>for(변수 of 객체){

}
</code></pre><hr>
</br>


<h2 id="📑-함수functions"><strong>📑 함수(functions)</strong></h2>
</br>

<h3 id="-👉함수-선언">** 👉함수 선언**</h3>
<h4 id="-1️⃣-function-생성자">** 1️⃣ Function 생성자**</h4>
<pre><code>function 함수명([매개변수1, 매개변수2, ...매개변수N]){

        실행 코드(statements)
}</code></pre><p>생성된 함수는 함수객체로 일반적인 기능 외에 모든 속성, 메서드, 객체의 행위특성 을 갖는다.</p>
<p>호이스팅 영향 o </p>
<blockquote>
<p><strong>매개변수(parameter)</strong> : 함수로 전달되는 인수를 함수에서 사용하기 위해 사용하는 변수<br><strong>인수(argument)</strong> : 함수가 호출될 때 전달되는 값</p>
</blockquote>
<h4 id="2️⃣-함수-표현식function-expression"><strong>**2️⃣</strong> 함수 표현식(function expression)**</h4>
<p>함수 리터럴로 생성한 함수를 변수에 할당한 표현식</p>
<pre><code> let 이름 = function [함수명](매개변수1,매개변수2, ... 매개변수N){
 실행 코드(statements) 
 };</code></pre><h4 id="3️⃣-화살표-함수arrow-functions"><strong>3️⃣ 화살표 함수(arrow functions)</strong></h4>
<pre><code>(매개변수1, 매개변수2,...매개변수N)) =&gt; { 실행 코드 }

(매개변수1, 매개변수2,...매개변수N)) =&gt; 표현식

매개변수가 1개이면 괄호가 없어도 됨

매개변수 =&gt; { 실행 코드 }

매개변수가 없으면 괄호가 있어야 됨

() =&gt; { 실행 코드 }</code></pre><blockquote>
<p><strong>🔷 함수 리터럴(function literal)</strong><br>     이름없이 몸체만 있는 익명 함수, 변수와 동일한 문법과 구조를 사용해 함수를 생성</p>
</blockquote>
<p><strong>👀 IIFE(Immediately Invoked Function Expression) : 즉시 실행 함수</strong></p>
<p>▪ 정의와 동시에 실행되는 함수</p>
<blockquote>
<p> ( function() {<br>          실행 코드 <br>})();</p>
</blockquote>
<p>첫 번째 괄호 () : 익명함수(Anonymous Function)
두 번째 괄호 ()  : 즉시 실행 함수를 생성하는 괄호. 이 괄호를 통해 자바스크립트 엔진(JavaScript engine)은 함수를 즉시 해석해서 실행한다.</p>
<p><strong>익명함수(Anonymous Function)</strong> : 리터럴 방식의 함수</p>
<hr>
<h2 id="📑-이벤트"><strong>📑</strong> <strong>이벤트</strong></h2>
<p>이벤트소스<br>이벤트리스너<br>이벤트객체<br>이벤트핸들러<br>이벤트흐름</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[[프로그래머스] 소수찾기]]></title>
            <link>https://velog.io/@dev____123/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%86%8C%EC%88%98%EC%B0%BE%EA%B8%B0</link>
            <guid>https://velog.io/@dev____123/%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%A8%B8%EC%8A%A4-%EC%86%8C%EC%88%98%EC%B0%BE%EA%B8%B0</guid>
            <pubDate>Mon, 22 May 2023 17:36:35 GMT</pubDate>
            <description><![CDATA[<p><a href="https://school.programmers.co.kr/learn/courses/30/lessons/42839">출처 programmers</a></p>
<blockquote>
<p>순열</p>
</blockquote>
<pre><code>numbers = []
def Permutation(array, depth, n, k):
  # array 배열 depth 깊이 n:배열길이 k뽑아낼 숫자개수
    if depth == k:  # 뽑아낼 숫자개수만큼 깊이
        numbers.append(int(&#39;&#39;.join(array[:k])))
    for i in range(depth, n):
        array[depth], array[i] = array[i], array[depth]
        Permutation(array, depth + 1, n, k)
        array[depth], array[i] = array[i], array[depth] # 배열 되돌리기

def PrimeN(n):
    for i in range(2,n):
        if n % i == 0:
            return False
    return True

def solution(number):
    array = list(number)
    for i in range(1,len(array)+1):
        Permutation(array, 0, len(array), i)
    s = set(numbers)

    #소수 구하기
    cnt = 0
    for i in s:
        if i == 0 or i == 1:
            continue
        if PrimeN(i):
            cnt+=1    
    return cnt</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[싸피 적성진단 망한 후기]]></title>
            <link>https://velog.io/@dev____123/%EC%8B%B8%ED%94%BC-%EC%A0%81%EC%84%B1%EC%A7%84%EB%8B%A8-%EB%A7%9D%ED%95%9C-%ED%9B%84%EA%B8%B0</link>
            <guid>https://velog.io/@dev____123/%EC%8B%B8%ED%94%BC-%EC%A0%81%EC%84%B1%EC%A7%84%EB%8B%A8-%EB%A7%9D%ED%95%9C-%ED%9B%84%EA%B8%B0</guid>
            <pubDate>Sun, 21 May 2023 08:46:14 GMT</pubDate>
            <description><![CDATA[<p>╭┈┈┈┈╯    ╰┈┈┈╮</p>
<p>  ╰┳┳╯    ╰┳┳╯</p>
<p>   o 　    　　o</p>
<p> o   　   　　o</p>
<p>    ╰┈┈╯</p>
<p>  o ╭━━━━━╮　 o</p>
<p>      ┈┈┈┈</p>
<p>　　o     　　o</p>
<p>  한시간 동안 눈물 닦고 바로 쓰는 따끈따끈한 후기
  망함 
  망해서 더 적을게 없음
  문제는 오〰〰〰〰〰할만한데? 했는데
  왜
  대체 왜
  답이 안나옴
  긴장해서 머리는 안돌고 정말 손에 땀띠 나는줄..
  생각하면 슬프니깐 이제 그냥 잊어버려야지,,
  더 슬픈건 끝나고 다시 풀어보니 20분컷이더라..</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[3314. 보충학습과 평균]]></title>
            <link>https://velog.io/@dev____123/3314.-%EB%B3%B4%EC%B6%A9%ED%95%99%EC%8A%B5%EA%B3%BC-%ED%8F%89%EA%B7%A0</link>
            <guid>https://velog.io/@dev____123/3314.-%EB%B3%B4%EC%B6%A9%ED%95%99%EC%8A%B5%EA%B3%BC-%ED%8F%89%EA%B7%A0</guid>
            <pubDate>Sun, 21 May 2023 04:52:49 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWBnA2jaxDsDFAWr">출처 : swexpertacademy 3314번</a></p>
<pre><code>
T= int(input())
for test_case in range(1, T+1):
    score = list(map(int, input().split()))
    for i in range(len(score)):
        if score[i] &lt; 40 :
            score[i] = 40
    print(&#39;#&#39;+str(test_case), sum(score)//len(score))
</code></pre><blockquote>
<p>난이도 D1</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[(D3)2805. 농작물 수확하기]]></title>
            <link>https://velog.io/@dev____123/D32805.-%EB%86%8D%EC%9E%91%EB%AC%BC-%EC%88%98%ED%99%95%ED%95%98%EA%B8%B0</link>
            <guid>https://velog.io/@dev____123/D32805.-%EB%86%8D%EC%9E%91%EB%AC%BC-%EC%88%98%ED%99%95%ED%95%98%EA%B8%B0</guid>
            <pubDate>Sat, 20 May 2023 13:59:57 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV7GLXqKAWYDFAXB">링크텍스트</a></p>
<pre><code>T = int(input())
for test_case in range(1, T + 1):
    n = int(input())
    mlist = []
    m = (n-1)//2
    sumn = 0
    cnt = 1
    for i in range(n):
        s = &#39;&#39;
        p = str(input())
        mlist.append(list(p))

        p1,p2 =0,0
        if i == 0 or i == n - 1:
            sumn += int(mlist[i][m])
        elif i &gt; m:
            p1 = list(map(int, mlist[i][cnt:m]))
            p2 = list(map(int, mlist[i][m+1:m+1+len(p1)]))
            sumn += sum(p1+p2)+int(mlist[i][m])
            cnt += 1
        else:
            p1 = list(map(int, mlist[i][m - i:m]))
            p2 = list(map(int, mlist[i][m+1:m + i +1]))
            sumn += sum(p1+p2)+int(mlist[i][m])
    print(&#39;#&#39; + str(test_case), sumn)</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[(D3)6692. 다솔이의 월급 상자]]></title>
            <link>https://velog.io/@dev____123/D36692.-%EB%8B%A4%EC%86%94%EC%9D%B4%EC%9D%98-%EC%9B%94%EA%B8%89-%EC%83%81%EC%9E%90</link>
            <guid>https://velog.io/@dev____123/D36692.-%EB%8B%A4%EC%86%94%EC%9D%B4%EC%9D%98-%EC%9B%94%EA%B8%89-%EC%83%81%EC%9E%90</guid>
            <pubDate>Sat, 20 May 2023 13:55:28 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWdXofhKFkADFAWn">출처 :sw expert academy</a></p>
<pre><code>T = int(input())
# 여러개의 테스트 케이스가 주어지므로, 각각을 처리합니다.
for test_case in range(1, T + 1):
    n = int(input())
    s = 0
    for i in range(n):
        x, y = map(float, input().split())
        s += x*y
    print(&quot;{:.6f}&quot;.format(s))</code></pre><blockquote>
<p>소수점 N자리까지 출력
&quot;{:.Nf}&quot;.format(숫자)
round(숫자)반올림
maht.ceil 올림
math.floor 내림
math.trunc 소수점 버리기</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[(D3)8500. 극장 좌석]]></title>
            <link>https://velog.io/@dev____123/D38500.-%EA%B7%B9%EC%9E%A5-%EC%A2%8C%EC%84%9D</link>
            <guid>https://velog.io/@dev____123/D38500.-%EA%B7%B9%EC%9E%A5-%EC%A2%8C%EC%84%9D</guid>
            <pubDate>Sat, 20 May 2023 13:07:05 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWz5yIfq74QDFARQ">출처 :sw expert academy</a></p>
<h4 id="👉-java">👉 Java</h4>
<pre><code>import java.util.Scanner;
import java.io.FileInputStream;
import java.util.Arrays;

class Solution
{
    public static void main(String args[]) throws Exception
    {

        Scanner sc = new Scanner(System.in);
        int T;
        int cnt;
        T=sc.nextInt();
        int[] num;
        for(int test_case = 1; test_case &lt;= T; test_case++)
        {
            cnt = 0;
            int n = sc.nextInt();
            num = new int[n];
            for (int i = 0; i &lt; n ; i++){
                num[i] = sc.nextInt();
               // System.out.println(integer[i]);
            }
            Arrays.sort(num);
            for ( int i = 0; i&lt; n; i++){
                if( i == n-1){
                    cnt += num[i]*2+1;
                }else{
                    cnt += num[i]+1;
                }
            }

            System.out.println(&#39;#&#39;+String.valueOf(test_case)+&#39; &#39;+cnt);

        }
    }
}</code></pre><hr>
<p>👉 python</p>
<pre><code>T = int(input())

for test_case in range(1, T + 1):
    N = int(input())
    mlist = list(map(int, input().split()))
    mlist.sort()
    cnt = 0
    for i in range(len(mlist)):
        if i == N-1 :
            cnt+= mlist[i]*2+1
        else :
            cnt+=mlist[i]+1

    print(&#39;#&#39; + str(test_case), cnt)</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[(D2)1945. 간단한 소인수분해]]></title>
            <link>https://velog.io/@dev____123/D21945.-%EA%B0%84%EB%8B%A8%ED%95%9C-%EC%86%8C%EC%9D%B8%EC%88%98%EB%B6%84%ED%95%B4</link>
            <guid>https://velog.io/@dev____123/D21945.-%EA%B0%84%EB%8B%A8%ED%95%9C-%EC%86%8C%EC%9D%B8%EC%88%98%EB%B6%84%ED%95%B4</guid>
            <pubDate>Sat, 20 May 2023 10:06:27 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pl0Q6ANQDFAUq">출처 : sw expert academy</a></p>
<pre><code>nlist = [2,3,5,7,11]
T = int(input())

for test_case in range(1, T + 1):
    N = int(input())
    print(&#39;#&#39; + str(test_case), end=&#39; &#39;)
    cnt, x = 0, 0

    for i in range(len(nlist)):
        if N % nlist[i] == 0:
            x = nlist[i]
            while N % x == 0 :
                x *= nlist[i]
                cnt+=1
            N //= (nlist[i]**cnt)
        print(cnt, end=&#39; &#39;)
        cnt = 0
    print()
</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[(D3)1234.비밀번호]]></title>
            <link>https://velog.io/@dev____123/D31234.%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8</link>
            <guid>https://velog.io/@dev____123/D31234.%EB%B9%84%EB%B0%80%EB%B2%88%ED%98%B8</guid>
            <pubDate>Fri, 19 May 2023 14:18:35 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV14_DEKAJcCFAYD">출처 : sw expert academy</a></p>
<pre><code>T = 10
for test_case in range(1, T+1):
    N, M = map(str, input().split()) # N : 문자열의 총 수  M : 문자열
    toggle = True
    while toggle:
        s = &#39;&#39;
        for i in range(len(M)-1): 
            s = M[i]
            if s == M[i+1] :
                M = M.replace(M[i:i+2],&#39;&#39;)
                break
            elif i == len(M)-2 :
                toggle = False

    print(&#39;#&#39;+str(test_case),M)</code></pre>]]></description>
        </item>
        <item>
            <title><![CDATA[(D2)2001. 파리 퇴치]]></title>
            <link>https://velog.io/@dev____123/2001.-%ED%8C%8C%EB%A6%AC-%ED%87%B4%EC%B9%98</link>
            <guid>https://velog.io/@dev____123/2001.-%ED%8C%8C%EB%A6%AC-%ED%87%B4%EC%B9%98</guid>
            <pubDate>Fri, 19 May 2023 13:44:06 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PzOCKAigDFAUq">문제 출처 :sw expert academy</a></p>
<pre><code>T = int(input())
for test_case in range(1, T+1):
    N, M = map(int, input().split()) # N : 배열크기 NXN  M : 파리채크기 MxM
    mlist = []
    max = 0
    for i in range(N):
        mlist.append(list(map(int, input().split())))
    for i in range(N-M+1):
        for j in range(N-M+1):
            s = 0
            for k in range(M):
                for l in range(M):
                    s += mlist[i+k][j+l]
                    # print(s)
            if max &lt; s : max = s
    print(&#39;#&#39;+str(test_case),max)</code></pre><blockquote>
<p>4중 for문이라니...
이렇게 풀면 안될 것 같지만 우선 당장 풀 수 있는 방법으로 해봄
테스트 케이스 5개가 자꾸 틀리길래 고생했는데 파리채 행렬이 1번 덜 움직여서 였다. +1하니깐 답나옴ㅠ</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[1961. 숫자 배열 회전]]></title>
            <link>https://velog.io/@dev____123/1961.-%EC%88%AB%EC%9E%90-%EB%B0%B0%EC%97%B4-%ED%9A%8C%EC%A0%84</link>
            <guid>https://velog.io/@dev____123/1961.-%EC%88%AB%EC%9E%90-%EB%B0%B0%EC%97%B4-%ED%9A%8C%EC%A0%84</guid>
            <pubDate>Fri, 19 May 2023 13:24:03 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5Pq-OKAVYDFAUq">출처 : sw expert academy</a></p>
<pre><code>T = int(input())
for test_case in range(1, T+1):
    print(&#39;#&#39;+str(test_case))
    N = int(input())
    nlist = [] # 회전한 배열 저장 할 리스트
    mlist = [] # 입력 받은 배열 저장 리스트
    slist = [[&#39;0&#39;]*3 for _ in range(N)]
    for _ in range(N):
        mlist.append(list(map(str, input().split())))
    for i in range(3): # 90 / 180 / 270 . 3번 회전
        mlist = list(map(list, zip(*mlist[::-1]))) # 배열 거꾸로 만든 후 행렬 바꾸기
        for j in mlist:
            nlist.append(j)
    nlist = nlist[::-1] # 배열 순서 바꾸기 deque 사용시 안바꿔도됨
    for i in range(3):
        for j in range(N):
            s = nlist.pop() # 가장 뒤쪽부터 뽑아냄
            slist[j][i] = &#39;&#39;.join(s)
    for i in range(N):
        print(&#39; &#39;.join(slist[i]), end=&#39; &#39;)
        print()</code></pre><blockquote>
<p>배열 행렬 바꾸기
list(map(list, zip(*mylist)))
배열 거꾸로 출력
list[::-1] # 문자열도 가능</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[(D2)1954. 달팽이 숫자/]]></title>
            <link>https://velog.io/@dev____123/D21954.-%EB%8B%AC%ED%8C%BD%EC%9D%B4-%EC%88%AB%EC%9E%90</link>
            <guid>https://velog.io/@dev____123/D21954.-%EB%8B%AC%ED%8C%BD%EC%9D%B4-%EC%88%AB%EC%9E%90</guid>
            <pubDate>Fri, 19 May 2023 10:06:33 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PobmqAPoDFAUq">링크텍스트</a></p>
<pre><code>T = int(input())
for test_case in range(1, T+1):
    print(&#39;#&#39;+str(test_case))
    N = int(input())
    mlist = [[0]*N for _ in range(N)]
    p1,p2 = 0,0
    d = 0
    chk = []
    for i in range(1,N*N+1):
        if mlist[p1][p2] == 0  :
            mlist[p1][p2] = i
        chk.append(i)
        # 방향 알기
        if d == 0 : #오
            p2 +=1
            if p2 == N or mlist[p1][p2] in chk :
                p2 -=1
                p1 +=1
                d = 1
        elif d == 1 : #아래
            p1 += 1
            if p1 == N or mlist[p1][p2] in chk :
                p1 -= 1
                p2 -= 1
                d = 2
        elif d == 2 : # 왼
            p2 -= 1
            if p2 &lt; 0 or mlist[p1][p2] in chk :
                p2 +=1
                p1 -=1
                d = 3
        elif d == 3 : #위
            p1 -= 1
            if p1 &lt; 0 or mlist[p1][p2] in chk:
                p1 +=1
                p2 +=1
                d = 0

    for i in mlist:
        for j in i:
            print(j, end=&#39; &#39;)
        print()</code></pre><blockquote>
<p>무식하게 풀어봄
dfs이용해서 다시 풀어보기</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[(D2)1948. 날짜 계산기]]></title>
            <link>https://velog.io/@dev____123/D21948.-%EB%82%A0%EC%A7%9C-%EA%B3%84%EC%82%B0%EA%B8%B0</link>
            <guid>https://velog.io/@dev____123/D21948.-%EB%82%A0%EC%A7%9C-%EA%B3%84%EC%82%B0%EA%B8%B0</guid>
            <pubDate>Fri, 19 May 2023 03:40:22 GMT</pubDate>
            <description><![CDATA[<p><a href="https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PnnU6AOsDFAUq">출처 : sw expert academy</a></p>
<pre><code>day = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

T = int(input())
for test_case in range(1, T + 1):
    n1, n2, m1, m2 = map(int, input().split())
    d1 = sum(day[:n1-1])+n2
    d2 = sum(day[:m1-1])+m2
    print(d2-d1+1)</code></pre>]]></description>
        </item>
    </channel>
</rss>