programmers.co.kr/learn/courses/30/lessons/42888
코딩테스트 연습 - 오픈채팅방
오픈채팅방 카카오톡 오픈채팅방에서는 친구가 아닌 사람들과 대화를 할 수 있는데, 본래 닉네임이 아닌 가상의 닉네임을 사용하여 채팅방에 들어갈 수 있다. 신입사원인 김크루는 카카오톡 오
programmers.co.kr
def solution(record):
result = []
id = {}
for i in record:
if i.split()[0]=="Enter" or i.split()[0]=="Change":
id[i.split()[1]]=i.split()[2]
for i in record:
if i.split()[0]=="Enter":
result.append(id.get(i.split()[1])+"님이 들어왔습니다.")
elif i.split()[0]=="Leave":
result.append(id.get(i.split()[1])+"님이 나갔습니다.")
return result
'자기개발👨💻 > 코딩 알고리즘' 카테고리의 다른 글
[Python] 백준 4673 셀프넘버 (환기_성공) (0) | 2021.06.20 |
---|---|
[python] 백준1145 적어도 대부분의 배수 (0) | 2021.03.11 |
[python] 백준 1032 명령프롬프트 (0) | 2021.03.10 |
[python] 프로그래머스 2019kakao 실패율 (0) | 2021.02.21 |
[python] 백준 10814 나이순 정렬 (0) | 2021.01.31 |
[python] 프로그래머스 카펫 (0) | 2021.01.07 |