일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 알리
- error
- 취미미술
- 블린이
- 마이그레이트
- Uncaught SyntaxError
- Django
- scotty
- JavaScript
- ModuleNotFoundError
- bootstrap4
- include
- 오류
- 조맹클래스101
- TemplateSyntaxError
- ValueError
- 크로키
- pip install --upgrade pip
- navbar
- 마이그레이션
- You should consider upgrading
- junny
- Python
- Migrate
- 조맹크로키
- Today
- Total
목록알고리즘 (2)
내가 하고 싶은 것들 중 하나

https://programmers.co.kr/learn/courses/30/lessons/12924 나는 합을 구하라고 하면.. 리스트에 어펜드해서 sum 하는 것이 일단 떠오른다. 그런데 어펜드는 효율성 면에서 매우 좋지 않다. 대안은 리스트에 원소를 넣어서 더해주려고 하지말고, 숫자를 바로 더해주면 된다 #append 쓸 경우 def solution(n): answer = 0 start_num = 1 while start_num n: break start_num += 1 return answer 더 나은 풀이 #append 안쓰고 바로 더해주기 def solution(n): answer = 0 start_num = 1 while start_num n: break start_num += 1 retur..

아이콘 제작자 Skyclick from www.flaticon.com from collections import Counter def solution(participant, completion): answer = '' part_count = Counter(participant) part_count.subtract(completion) #for idx, value in part_count.items(): #if value == 1: #answer += idx answer = [key for (key, value) in part_count.items() if value == 1][0] return answer A와 B 리스트에서 중복되는 값을 지우고 남는 값이 무엇인지 구할 때 Counter ..