Cody

# Problem 1909. Two fractions, one sum

Solution 1422099

Submitted on 22 Jan 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

### Test Suite

Test Status Code Input and Output
1   Fail
x = 10; y_correct = 5; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

2   Fail
x = 120; y_correct = 32; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

3   Fail
x = 9240; y_correct = 284; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

4   Fail
x = 510510; y_correct = 1094; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

5   Fail
x = 223092869; y_correct = 14; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

6   Fail
x = 223092870; y_correct = 9842; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

7   Fail
x = 223092871; y_correct = 5; assert(isequal(two_fractions(x),y_correct))

Z = 1 Z = 1 1 y = 2

Assertion failed.

8   Fail
assert(isequal(two_fractions(two_fractions(10^7)+two_fractions(10^8)),14))

Z = 1 Z = 1 1 y = 2

Assertion failed.

9   Fail
tic satf=sum(arrayfun(@(x) two_fractions(x),1:10000)); assert(isequal(satf,186991)) toc

Z = 1 Z = 1 1 y = 2

Assertion failed.