Cody

Solution 1352313

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   Pass
X='6546468768680988454345'; Y='5757557542432424209808098908085353545657657'; Z='5757557542432424209814645376854034534112002'; assert(isequal(dda(X,Y),Z))

Z = '2' Z = '02' Z = '002' Z = '2002' Z = '12002' Z = '112002' Z = '4112002' Z = '34112002' Z = '534112002' Z = '4534112002' Z = '34534112002' Z = '034534112002' Z = '4034534112002' Z = '54034534112002' Z = '854034534112002' Z = '6854034534112002' Z = '76854034534112002' Z = '376854034534112002' Z = '5376854034534112002' Z = '45376854034534112002' Z = '645376854034534112002' Z = '4645376854034534112002' Z = '14645376854034534112002' Z = '814645376854034534112002' Z = '9814645376854034534112002' Z = '09814645376854034534112002' Z = '209814645376854034534112002' Z = '4209814645376854034534112002' Z = '24209814645376854034534112002' Z = '424209814645376854034534112002' Z = '2424209814645376854034534112002' Z = '32424209814645376854034534112002' Z = '432424209814645376854034534112002' Z = '2432424209814645376854034534112002' Z = '42432424209814645376854034534112002' Z = '542432424209814645376854034534112002' Z = '7542432424209814645376854034534112002' Z = '57542432424209814645376854034534112002' Z = '557542432424209814645376854034534112002' Z = '7557542432424209814645376854034534112002' Z = '57557542432424209814645376854034534112002' Z = '757557542432424209814645376854034534112002' Z = '5757557542432424209814645376854034534112002'

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))