Cody

Problem 44785. Lunar Arithmetic (Addition)

Solution 2761816

Submitted on 31 Jul 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 5; y = 6; assert(isequal(lunarAddition(x,y),6))

varargin = 0 0 lunarResult = 6

2   Fail
x = 456; y = 789; assert(isequal(lunarAddition(x,y),789))

varargin = 45 78 varargin = 4 7 varargin = 0 0 lunarResult = 7

Assertion failed.

3   Fail
x = 86; y = 12374; assert(isequal(lunarAddition(x,y),12386))

varargin = 8 1237 varargin = 0 123 varargin = 0 12 varargin = 0 1 varargin = 0 0 lunarResult = 1

Assertion failed.

4   Fail
x = 29; y = 1652; z = 95412; assert(isequal(lunarAddition(x,y,z),95659))

varargin = 2 165 9541 varargin = 0 16 954 varargin = 0 1 95 varargin = 0 0 9 varargin = 0 0 0 lunarResult = 9

Assertion failed.

5   Fail
x = 33; y = 1111; z = 4456; a = 38; assert(isequal(lunarAddition(x,y,z,a),4458))

varargin = 3 111 445 3 varargin = 0 11 44 0 varargin = 0 1 4 0 varargin = 0 0 0 0 lunarResult = 4

Assertion failed.

6   Fail
x = 85214; y = 4785; z = 1; a = 850615; b = 14702140; assert(isequal(lunarAddition(x,y,z,a,b),14885785))

varargin = 8521 478 0 85061 1470214 varargin = 852 47 0 8506 147021 varargin = 85 4 0 850 14702 varargin = 8 0 0 85 1470 varargin = 0 0 0 8 147 varargin = 0 0 0 0 14 varargin = 0 0 0 0 1 varargin = 0 0 0 0 0 lunarResult = 1

Assertion failed.

7   Pass
x = 9; y = 0; assert(isequal(lunarAddition(x,y),9))

varargin = 0 0 lunarResult = 9