반응형
Recent Posts
Notice
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 알고리즘
- 큐
- BFS
- dfs
- 구현
- 혁펜하임
- 개발자취업
- 99항해
- 딥러닝
- 백준
- 해시
- 코딩테스트준비
- leetcode
- boj 2309
- 파이썬
- 활성화 함수
- Python
- 프로그래머스
- 항해99
- 백준 2309
- python 2309
- easy 딥러닝
- 개발자 취업
- 코딩테스트 준비
- BOJ
- softeer
- til
- 기능개발
- 스택
- 99클럽
Archives
- Today
- Total
동까의 코딩
99클럽 코테 스터디 TIL 본문
반응형
https://school.programmers.co.kr/learn/courses/30/lessons/64064
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
itertools의 permutations를 사용해서 모든 경우의 수를 만들어주면서 풀이하였습니다.
def solution(user_id, banned_id):
answer=0
import re
from itertools import permutations
answers = []
for p in permutations(user_id, len(banned_id)):
cnt = 0
for i in range(len(p)):
ban = banned_id[i].replace('*','.')
if re.match(ban,p[i]) and len(ban)==len(p[i]):
cnt+=1
if cnt==len(banned_id):
p = sorted(p)
if p not in answers:
answers.append(p)
answer = len(answers)
return answer
반응형
'문제 풀이 > 99클럽' 카테고리의 다른 글
99클럽 코테 스터디 TIL (0) | 2025.02.15 |
---|---|
99클럽 코테 스터디 TIL (0) | 2025.02.13 |
99클럽 코테 스터디 TIL 11일차 (0) | 2025.02.07 |
99클럽 코테 스터디 TIL 10일차 (0) | 2025.02.05 |
99클럽 코테 스터디 TIL 9일차 (0) | 2025.02.04 |