✅Easy Brute Force Solution✅
Intuition\n Describe your first thoughts on how to solve this problem. \nThe code is designed to add fractions together and simplify the result to its simplest 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThe code is designed to add fractions together and simplify the result to its simplest form. It handles both positive and negative fractions, and its goal is to perform this addition and provide the result as a simplified fraction.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nThe input expression is split into a list of strings, where each string represents a fraction to be added. The fractions are separated by the \'+\' sign.\nThe code then iterates through this list, parsing each fraction by splitting it based on the \'/\' character.\nWhile parsing each fraction, it keeps track of the numerators and denominators separately.\nThe code applies a sign depending on whether a \'-\' sign is present within the fraction.\nThe Least Common Denominator (LCD) is calculated for all denominators in the list using the reduce function from the functools module.\nOnce the LCD is determined, each numerator is adjusted to have a common denominator by multiplying it by (d//abs(denominator[i])), ensuring that all fractions have the same denominator.\nThe code sums up all the numerators to get the new numerator for the result.\nIt calculates the greatest common divisor (GCD) of the numerator and denominator using the math.gcd function.\nFinally, the code simplifies the fraction by dividing both the numerator and denominator by their GCD to get the simplest form of the result.\n\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nSplitting the input expression by \'+\' characters and then iterating through the list of fractions takes O(n) time, where n is the length of the expression.\nWithin the iteration, parsing each fraction also takes O(n) time.\nCalculating the Least Common Denominator (LCD) using the reduce function takes O(n) time, as it iterates through the list of denominators.\nAdjusting numerators for a common denominator and summing them up also takes O(n) time.\nCalculating the greatest common divisor (GCD) using the math.gcd function takes O(n) time.\nOverall, the time complexity of the code is O(n).\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nThe space complexity is influenced by the data structures used to store fractions (numerators and denominators), the list of fractions, and other variables.\nThe space used to store fractions and the list of fractions is O(n) in the worst case because they grow linearly with the input length.\nOther variables used for temporary calculations, such as the LCD, numerators, denominators, and the result, do not significantly impact the space complexity.\nTherefore, the overall space complexity is O(n) due to the storage of fractions and the list of fractions.\n\n\u2B06**IF IT FIND\'S HELPFUL PLAESE UPVOTE**\u2B06\n# Code\n```\nclass Solution:\n    def fractionAddition(self, expression: str) -> str:\n        l = expression.split(\'+\')\n\n        num = []\n        dum = []\n        for i in l:\n            temp = i.split(\'/\')\n            n= True\n\n            for i in temp:\n                if \'-\' in i and len(i)>2 and i.index(\'-\')>0:\n                    index = i.index(\'-\')\n\n                    dum.append(int(i[:index]))\n                    num.append(int(i[index:]))\n                    n=False\n                else:\n                    if n:\n                        num.append(int(i))\n                        n = False\n                    else:\n                        dum.append(int(i))\n                        n=True\n        d = reduce(math.lcm, dum)\n        for i in range(len(num)):\n            num[i] = num[i]*(d//abs(dum[i]))\n        n = sum(num)\n        return str(n//gcd(n,d))+"/"+str(d//gcd(n,d))\n```\n\u2B06**IF IT FIND\'S HELPFUL PLAESE UPVOTE**\u2B06
['Python3']