diff --git a/suhyun113/README.md b/suhyun113/README.md index a2c6ea2..78e2eed 100644 --- a/suhyun113/README.md +++ b/suhyun113/README.md @@ -2,5 +2,5 @@ | 차시 | 날짜 | 문제유형 | 링크 | 풀이 | |:----:|:---------:|:----:|:-----:|:----:| -| 1차시 | 2024.02.12 | DP | [평범한 배낭](https://www.acmicpc.net/problem/12865) | [#1](https://github.com/AlgoLeadMe/AlgoLeadMe-7/pull/5) | ---- +| 1차시 | 2024.03.25 | 그리디 | [체육복](https://school.programmers.co.kr/learn/courses/30/lessons/42862) | [#1](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/2) | +--- \ No newline at end of file diff --git "a/suhyun113/\352\267\270\353\246\254\353\224\224/1-suhyun113.py" "b/suhyun113/\352\267\270\353\246\254\353\224\224/1-suhyun113.py" new file mode 100644 index 0000000..7a2333d --- /dev/null +++ "b/suhyun113/\352\267\270\353\246\254\353\224\224/1-suhyun113.py" @@ -0,0 +1,14 @@ +def solution(n, lost, reserve): + answer = 0 + + re = list(set(reserve) - set(lost)) + lo = list(set(lost) - set(reserve)) + + for i in re: + if i-1 in lo: + lo.remove(i-1) + elif i+1 in lo: + lo.remove(i+1) + + answer = n - len(lo) + return answer \ No newline at end of file