인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

shinandmin130565's profile image
shinandmin130565

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

7. Curriculum Design (Q)

제 풀이 방식이 큐로 처리했다고 볼 수 있을까요?

Written on

·

135

0

import sys

sys.stdin = open("input.txt", "rt")

from collections import deque

answ = input()

n = int(input())

res = ""

for i in range(n) :

    tmp = list(map(str, input()))

    dq = deque(tmp)

    while dq :

        a = dq.popleft()

        if a in answ :

            res += a

    

    if res == answ :

        print("#%d YES" %(i+1))        

    else :

        print("#%d NO" %(i+1))

    res = ""

    

 

python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

큐 자료구조를 사용했으니 큐처리한 것이라고 봐야죠~~

shinandmin130565's profile image
shinandmin130565

asked

Ask a question