Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[23-01-31] hyuksoon.py #29

Merged
merged 3 commits into from
Jan 31, 2023
Merged

[23-01-31] hyuksoon.py #29

merged 3 commits into from
Jan 31, 2023

Conversation

chs98412
Copy link
Collaborator

@chs98412 chs98412 commented Jan 30, 2023

PR Summary

폰켓몬

set으로 한줄풀이 가능하지만 착실하게 해시로 풀었습니다
해시에 없으면 1, 있으면 value+1 해서(사실 +1 안해도 됨) 마지막에 해시 길이로 구했어요

올바른 괄호

학교에서 배운듯한 문제
'('만 스택에 쌓고 괄호는 짝이 맞아야 하기에 문자열 끝나기 전에 스택이 비어버리면 안됨
문자열 끝나고 스택에 괄호가 남아있어도 안됨
그냥 카운트해도 될듯

같은 숫자는 싫어

스택

ISSUE NUMBER

elif stk:
stk.pop()
else:
return False
Copy link
Owner

Choose a reason for hiding this comment

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

확실히 전체를 도는 것 보다 이미 실패가 확정일 때는 return 해서 종료하는게 효율적이겠네요🙂

@chs98412 chs98412 merged commit 92ad5f6 into da-in:main Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants