일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Algorithm
- 프로그래머스
- 백준
- programmers
- 코딩테스트
- BFS
- DP
- 구현
- 문자열 파싱
- 알고리즘
- 동적 프로그래밍
- 카카오
- 삼성sw역테
- 자바스크립트
- 쓰셨잖아
- sort
- 코드트리
- 파이썬
- DART
- JS
- 못그리지만
- 그래프 탐색
- Flutter
- c#
- BAEKJOON
- 자료구조
- 이진탐색
- 스터디
- Java
- JavaScript
- Today
- Total
목록programmers (2)
Algo 쓰자
def solution(s): words = {'zero': '0', 'one':'1', 'two':'2', 'three':'3','four':'4', 'five':'5', 'six':'6', 'seven':'7','eight':'8','nine':'9'} temp = '' answer = '' for c in s: if c in words.values() : answer += c else: temp += c if temp in words.keys() : answer += words[temp] temp = '' return int(answer) 초기 words 딕셔너리에 숫자의 영문표기를 키로하고 숫자(문자열)를 값으로 가지는 딕셔너리로 초기화 temp 문자열과 answer 문자열 선언 및 각각 빈 문자..
def solution(id_list, report, k): count = dict() reportCount = dict() report = list(set(report)) # 동일 신고에 대한 중복값 처리를 위해 set 변환 후 list 변환 for id in id_list: # 딕셔너리 초기화 count[id] = 0 reportCount[id] = 0 for str in report : # report에 저장된 각각의 문자열 파싱해 신고 횟수 누적 src, trg = str.split(' ') count[trg] += 1 for str in report : # src, trg = str.split(' ') if count[trg] >= k : reportCount[src] += 1 return li..