Java Solution Using Regex Expression
Complexity\n- Time complexity:O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity:O(1)\n Add your space complexity here, e.g. O(n) \n\n# Code
# Complexity\n- Time complexity:$$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```java []\nclass Solution {\n    private int GCD(int a, int b) {\n        return a == 0 ? Math.abs(b) : GCD(b % a, a);\n    }\n\n    public String fractionAddition(String expression) {\n        Scanner sc = new Scanner(expression).useDelimiter("/|(?=[-+])");\n        int A = 0, B = 1;\n        while (sc.hasNext()) {\n            int a = sc.nextInt(), b = sc.nextInt();\n            A = A * b + B * a;\n            B = B * b;\n\n            int gcd = GCD(A, B);\n            A /= gcd;\n            B /= gcd;\n        }\n        return A + "/" + B;\n    }\n}\n```
['Math', 'String', 'Simulation', 'Java']