Cody

Solution 1985043

Submitted on 21 Oct 2019
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
assessFunctionAbsence('regexp','FileName','digit_sum.m')

2   Pass
x = '123456789'; assert(isequal(digit_sum(x),9))

x = [] y = 45 z = '45' t = [] d = 9 u = 9 j = '9' n = [] s = 9

3   Pass
x = '13579'; assert(isequal(digit_sum(x),7))

x = [] y = 25 z = '25' t = [] d = 7 u = 7 j = '7' n = [] s = 7

4   Pass
x = '199'; assert(isequal(digit_sum(x),1))

x = [] y = 19 z = '19' t = [] d = 10 u = 10 j = '10' n = [] s = 1

5   Fail
x = '19999999999999999999999'; assert(isequal(digit_sum(x),1))

x = [] y = 199 z = '199' t = [] d = 19 u = 19 j = '19' n = [] s = 10

Assertion failed.

6   Pass
x = '1036654257757615301164620529930689045676735109259113932133140605724504628985272966102896725849035075'; assert(isequal(digit_sum(x),5))

x = [] y = 428 z = '428' t = [] d = 14 u = 14 j = '14' n = [] s = 5

7   Fail
x = '74021245485969262660226837606390444737401741361729271205654666692721644673648826558231964656575921104437679911605584367531520724637367403421848373873279364871895851147873501164141085965889086954824958'; assert(isequal(digit_sum(x),1))

x = [] y = 928 z = '928' t = [] d = 19 u = 19 j = '19' n = [] s = 10

Assertion failed.

8   Pass
x = '5851147873501164141085965889086954824958752606678975950184825606304112110625645414882256429011165097708998751310932346085834016381957924478113053129649177515212802040810341932020576007951832700665777265307367115487700079617116367572798033657320723526417122504117269467461912747320644603761100467516110111332287512097531691230649461317836258532443574410236994277771642081168571956087153534120969197542720767643838785694086392663104173875192923061073636098783655224289050890906758861210169349969736226546755550793938442137760897037722646218791104180057313259613054984813997639176837835953637446938790362276560342782718153854834909165636800962412231318093037756803017785098259784452756314377610539928858957504653988358962604698474998342789551842878266142728834686534787064418323355335697481001330501689595534408048368891285568524496673551564873437746977135402808065251650010486580915150789952155706519549648556325841434843312042241472703020112115992435204109497067652723884369953849057131345052221998713'; assert(isequal(digit_sum(x),3))

x = [] y = 4458 z = '4458' t = [] d = 21 u = 21 j = '21' n = [] s = 3

9   Pass
x = '908345908234987234589734591724598712345987345273472134987134589764359712459087124587213458149576345917461982455851147873501164141085965889086954824958752606678975950184825606304112110625645414882256429011165097708998751310932346085834016381957924478113053129649177515212802040810341932020576007951832700665777265307367115487700079617116367572798033657320723526417122504117269467461912747320644603761100467516110111332287512097531691230649461317836258532443574410236994277771642081168571956087153534120969197542720767643838785694086392663104173875192923061073636098783655224289050890906758861210169349969736226546755550793938442137760897037722646218791104180057313259613054984813997639176837835953637446938790362276560342782718153854834909165636800962412231318093037756803017785098259784452756314377610539928858957504653988358962604698474998342789551842878266142728834686534787064418323355335697481001330501689595534408048368891285568524496673551564873437746977135402808065251650010486580915150789952155706519549648556325841434843312042241472703020112115992435204109497067652723884369953849057131345059345982439827345092847145091842350981273459871458321098243593498348934598234098145091245845745091240912345931475871452221993493498324734583402901234912925903469023609823768684168426843682436846824645654268462546242684234365243284325436590349324982345923459832145097614359071642509832457234591249314598734590872134590871645098132450921347509237602389760914651346592451257153'; assert(isequal(digit_sum(x),6))

x = [] y = 6648 z = '6648' t = [] d = 24 u = 24 j = '24' n = [] s = 6