You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion was converted from issue #14 on September 15, 2026 10:58.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem link
https://leetcode.com/problems/basic-calculator/
Problem Summary
괄호, +, - 가 있는 간단한 계산기를 만드는 문제.
Solution
스택으로 하면 될 것 같다.
기본 기호 (+, -) 가 나오면 스택에 집어넣고, 괄호가 나오면 새로 스택을 쌓아주고 괄호가 닫히면 스택에서 하나를 더 빼주는 식으로 구현했다.
약간 코드가 지저분하지만 기본 흐름은 스택을 쓰는 것이다.
Source Code
All reactions