Cody

Solution 1352311

Submitted on 21 Nov 2017
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='98765432109876543210987654321098765432109876543210987654321'; Y='98765432109876543210987654321098765432109876543210987654321'; Z='197530864219753086421975308642197530864219753086421975308642'; assert(isequal(dda(X,Y),Z))

Z = '2' Z = '42' Z = '642' Z = '8642' Z = '08642' Z = '308642' Z = '5308642' Z = '75308642' Z = '975308642' Z = '1975308642' Z = '21975308642' Z = '421975308642' Z = '6421975308642' Z = '86421975308642' Z = '086421975308642' Z = '3086421975308642' Z = '53086421975308642' Z = '753086421975308642' Z = '9753086421975308642' Z = '19753086421975308642' Z = '219753086421975308642' Z = '4219753086421975308642' Z = '64219753086421975308642' Z = '864219753086421975308642' Z = '0864219753086421975308642' Z = '30864219753086421975308642' Z = '530864219753086421975308642' Z = '7530864219753086421975308642' Z = '97530864219753086421975308642' Z = '197530864219753086421975308642' Z = '2197530864219753086421975308642' Z = '42197530864219753086421975308642' Z = '642197530864219753086421975308642' Z = '8642197530864219753086421975308642' Z = '08642197530864219753086421975308642' Z = '308642197530864219753086421975308642' Z = '5308642197530864219753086421975308642' Z = '75308642197530864219753086421975308642' Z = '975308642197530864219753086421975308642' Z = '1975308642197530864219753086421975308642' Z = '21975308642197530864219753086421975308642' Z = '421975308642197530864219753086421975308642' Z = '6421975308642197530864219753086421975308642' Z = '86421975308642197530864219753086421975308642' Z = '086421975308642197530864219753086421975308642' Z = '3086421975308642197530864219753086421975308642' Z = '53086421975308642197530864219753086421975308642' Z = '753086421975308642197530864219753086421975308642' Z = '9753086421975308642197530864219753086421975308642' Z = '19753086421975308642197530864219753086421975308642' Z = '219753086421975308642197530864219753086421975308642' Z = '4219753086421975308642197530864219753086421975308642' Z = '64219753086421975308642197530864219753086421975308642' Z = '864219753086421975308642197530864219753086421975308642' Z = '0864219753086421975308642197530864219753086421975308642' Z = '30864219753086421975308642197530864219753086421975308642' Z = '530864219753086421975308642197530864219753086421975308642' Z = '7530864219753086421975308642197530864219753086421975308642' Z = '97530864219753086421975308642197530864219753086421975308642'

2   Fail
X='6546468768680988454345'; Y='5757557542432424209808098908085353545657657'; Z='5757557542432424209814645376854034534112002'; assert(isequal(dda(X,Y),Z))

Z = '7' Z = '57' Z = '657' Z = '7657' Z = '57657' Z = '657657' Z = '5657657' Z = '45657657' Z = '545657657' Z = '3545657657' Z = '53545657657' Z = '353545657657' Z = '5353545657657' Z = '85353545657657' Z = '085353545657657' Z = '8085353545657657' Z = '08085353545657657' Z = '908085353545657657' Z = '8908085353545657657' Z = '98908085353545657657' Z = '098908085353545657657' Z = '3098908085353545657657' Z = '53098908085353545657657' Z = '153098908085353545657657' Z = '4153098908085353545657657' Z = '64153098908085353545657657' Z = '664153098908085353545657657' Z = '2664153098908085353545657657' Z = '12664153098908085353545657657' Z = '412664153098908085353545657657' Z = '3412664153098908085353545657657' Z = '13412664153098908085353545657657' Z = '113412664153098908085353545657657' Z = '1113412664153098908085353545657657' Z = '11113412664153098908085353545657657' Z = '311113412664153098908085353545657657' Z = '6311113412664153098908085353545657657' Z = '26311113412664153098908085353545657657' Z = '026311113412664153098908085353545657657' Z = '4026311113412664153098908085353545657657' Z = '04026311113412664153098908085353545657657' Z = '304026311113412664153098908085353545657657' Z = '2304026311113412664153098908085353545657657'

Assertion failed.

3   Pass
X='122'; Y='323'; Z='445'; assert(isequal(dda(X,Y),Z))

Z = '5' Z = '45' Z = '445'

4   Fail
X='767678686868667868635435353545'; Y='465464643244242424249787979'; Z='768144151511912111059685141524'; assert(isequal(dda(X,Y),Z))

Undefined function or variable 's2'. Error in dda (line 22) num = str2num(s1(i)) + str2num(s2(i)) + remainder; Error in Test4 (line 4) assert(isequal(dda(X,Y),Z))