Skip to content

[Sehwan]Week2 solutions with JavaScript #58

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

Merged
merged 5 commits into from
May 10, 2024
Merged

Conversation

nhistory
Copy link
Contributor

@nhistory nhistory commented May 8, 2024

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

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

오우... 테스트까지 해보셨군요 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

네네 이렇게 만들어보니까 링크드 리스트에 대한 이해도가 조금 더 올라가는 것 같아요 ㅎㅎ

@DaleSeo DaleSeo added the week2 label May 8, 2024
Comment on lines +10 to +15
// If it is an open bracket, push the close bracket into stack array
if (char === "(") stack.push(")");
else if (char === "{") stack.push("}");
else if (char === "[") stack.push("]");
// If it is not an open bracket, compare last element of stack array
else if (char !== stack.pop()) return false;
Copy link
Member

Choose a reason for hiding this comment

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

보통 여는 괄호를 스택에 넣고, 닫는 괄호가 나올 때, 여는 괄호를 스택에서 꺼내서 둘이 쌍이 맞는지를 확인하는데요. 이렇게 처음부터 쌍이 맞는 닫는 괄호를 넣어두는 것도 신선한 접근이네요! 아주 좋습니다. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

감사합니다. 🙏

@DaleSeo DaleSeo merged commit b1f1bb2 into DaleStudy:main May 10, 2024
1 check passed
@DaleSeo DaleSeo added this to the week2 milestone May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants