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 #145 on September 15, 2026 11:13.
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/fraction-addition-and-subtraction/
Problem Summary
분수들의 식이 주어질 때 계산하는 문제
Solution
스트링 파싱 후 계산하면 된다.
초등학교 때 배운 분수의 덧셈 그대로 구현하면 되는데 분모는 최소공배수로 맞추고 분자끼리 더한 후 최대공약수로 분자와 분모를 각각 나눠주면 된다.
정규표현식으로 파싱이 깔끔하게 되는거 같은데 난 무식하게... 하나씩 파싱했다 ㅋㅋ
Source Code
All reactions