Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

문자열 폭발-최규호 #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

leachoi03
Copy link
Contributor

맨 밑 부분에 작성한 과정으로 코드가 실행되는게 맞는지 확인해주세요 : )

leachoi03 added 3 commits May 6, 2022 23:27
회전하는 큐
백준 1021번:회전하는 큐
최규호
Comment on lines +9 to +25
for c in string:
stack.append(c) #스택 삽입
if c == last and ''.join(stack[-b_length:]) == bomb:
#입력 받은 문자열에서 c == 폭발 문자열의 마지막 문자('4')
#스택의 끝부터 폭발 문자열의 길이만큼의 문자열 == 폭발 문자열
#(ex) ''.join(stack[-2:]) == bomb
del stack[-b_length:]
#스택의 끝부터 폭발 문자열의 길이만큼의 문자열 삭제

answer=''.join(stack)
#스택의 남은 문자열 합치기

if answer == '': #stack이 비어있으면
print("FRULA")
else:
print(answer)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

정확히 이해했다면 문제 없는 것 같아

Comment on lines +2 to +3
string = input() #입력 받은 문자열 (ex) mirkovC4nizCC44
bomb=input() #폭발 문자열 (ex) C4
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

입력받는 속도를 줄이기 위해 sys.stdin.readline().rstrip()에 대해 공부하면 좋을 것 같아:]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants