O(N) time complexity and O(1) Space complexity
Code\npython3 []\nfrom fractions import Fraction\nclass Solution:\n    def fractionAddition(self, e: str) -> str:\n        total = Fraction(0)\n        i = 0\n 
Code\n```python3 []\nfrom fractions import Fraction\nclass Solution:\n    def fractionAddition(self, e: str) -> str:\n        total = Fraction(0)\n        i = 0\n        n = len(e)\n        while i < len(e):\n            if e[i] == \'-\':\n                sign = -1\n                i += 1\n            else:\n                sign = 1\n                if e[i] == \'+\':\n                    i += 1\n            j = i\n            while i < len(e) and e[i] != \'/\':\n                i += 1\n            up = int(e[j:i])\n            i += 1\n            k = i\n            while i < len(e) and (e[i].isdigit()):\n                i += 1\n            down = int(e[k:i])\n            total = total + Fraction(sign * up, down)\n        return f"{total.numerator}/{total.denominator}"\n```
['Python3']