본문 바로가기
python-algorithm

백준 11008 복붙의 달인

by 무적김두칠 2022. 12. 13.

https://www.acmicpc.net/problem/11008

 

11008번: 복붙의 달인

한신이는 대학교에서 "복붙의 달인"으로 유명하다. 한신이는 타이핑 속도가 느리기 때문에 대학에서 가능한 모든 일을 복붙으로 해결한다. 그는 n개의 문자를 입력하는데 있어서 n초의 시간

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
def sol(origin_string, clipboard_string):
    origin_string = origin_string.replace(clipboard_string,'*')
    return len(origin_string)
 
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        origin_string, clipboard_string = input().split()
        print(sol(origin_string, clipboard_string))
cs

replace 함수를 통해 쉽게 구현가능합니다.
Use replace

반응형

'python-algorithm' 카테고리의 다른 글

백준 26489 Gum Gum for Jay Jay  (0) 2022.12.17
백준 26057 Большой удой  (1) 2022.12.13
백준 16360 Go Latin  (0) 2022.12.13
백준 26307 Correct  (0) 2022.12.13
백준 16208 귀찮음  (0) 2022.12.12

댓글