Company: Codenation_23june
Difficulty: medium
Sum of Fractions Problem Description Your task is to find the sum of two fractions, expressed in the form x/y and u/v where x, y, u, and v are four integers. Compute their sum and reduce it to its lowest indivisible state: A/B. For example: 2/6+2/6 equals 4/6, which should be reduced to 2/3. 7/10+13/10 equals 20/10 which should be reduced to 2/1. You are given an array of strings, which contains several expressions in the form "x/y+u/v". Return a string array, where the i th element is the result for the i th expression in the form "A/B". Examples Example 1: Input: fractions = ["2/6+2/6", "7/10+13/10"] Output: ["2/3", "2/1"] Explanation: For "2/6+2/6", the sum is 4/6, which reduces to 2/3. For "7/10+13/10", the sum is 20/10, which reduces to 2/1. Constraints 1 ≤ fractions.length ≤ 500 fractions[i] has the form "x/y+u/v" where x, y, u, v are integers. 1 ≤ x, y, u, v ≤ 2000 Input/Output Execution Time Limit: 0.5 seconds (cpp) Memory Limit: 1 GB Input: array.string fractions A