Company: Codenation_23june
Difficulty: medium
Sum of Fractions Problem Description You are given several arithmetic expressions. Each expression adds two positive fractions and is written as a single string with no spaces, in the form "x/y+u/v" — here x and u are numerators, y and v are denominators, and all four are positive integers. For each expression, add the two fractions and reduce the result to its lowest terms. Report the reduced result as a string "A/B" , where A and B share no common factor greater than 1. The denominator is always printed, even when it reduces to 1. For example 7/10+13/10 sums to 20/10 , which reduces to 2/1 , and the answer is the string 2/1 — not 2 . Input Format The first line contains a single integer n , the number of expressions. Each of the next n lines contains one expression fractions[i] , a string of the form x/y+u/v with no spaces anywhere in it. (inferred — the source presents this as a function taking an array of strings and states no stdin format. One expression per line