{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-05-26T00:16:20.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-05-26T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":563,"title":"How to add?","description":"* Imagine you are in 2222 Anno Domini, when everyone must learn how to add,\r\n* and competing for the highly prestigious post of,\r\n* Chief Comptroller of Dda Corporation.\r\n* You are being tested via \u003chttp://www.mathworks.com/matlabcentral/cody MATLAB Cody\u003e for addition of two positive integers X and Y,\r\n* both are fortunately in decimal system, and only a few dozen digits or less, \r\n* and delivered as ASCII strings.\r\n* Please output the result Z in similar style.\r\n* Please adopt a general strategy, as X and Y may be changed later.\r\n* Please rename the function Z = dda(X,Y).\r\n* Function Template:\r\n    \r\n  function Z = dda(X,Y)\r\n     X='98765432109876543210987654321098765432109876543210987654321'\r\n     Y='98765432109876543210987654321098765432109876543210987654321'\r\n     Z='197530864219753086421975308642197530864219753086421975308642';\r\n  end\r\n","description_html":"\u003cul\u003e\u003cli\u003eImagine you are in 2222 Anno Domini, when everyone must learn how to add,\u003c/li\u003e\u003cli\u003eand competing for the highly prestigious post of,\u003c/li\u003e\u003cli\u003eChief Comptroller of Dda Corporation.\u003c/li\u003e\u003cli\u003eYou are being tested via \u003ca href=\"http://www.mathworks.com/matlabcentral/cody\"\u003eMATLAB Cody\u003c/a\u003e for addition of two positive integers X and Y,\u003c/li\u003e\u003cli\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\u003c/li\u003e\u003cli\u003eand delivered as ASCII strings.\u003c/li\u003e\u003cli\u003ePlease output the result Z in similar style.\u003c/li\u003e\u003cli\u003ePlease adopt a general strategy, as X and Y may be changed later.\u003c/li\u003e\u003cli\u003ePlease rename the function Z = dda(X,Y).\u003c/li\u003e\u003cli\u003eFunction Template:\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003efunction Z = dda(X,Y)\r\n   X='98765432109876543210987654321098765432109876543210987654321'\r\n   Y='98765432109876543210987654321098765432109876543210987654321'\r\n   Z='197530864219753086421975308642197530864219753086421975308642';\r\nend\r\n\u003c/pre\u003e","function_template":"function Z = dda(X,Y)\r\n   X='98765432109876543210987654321098765432109876543210987654321';\r\n   Y='98765432109876543210987654321098765432109876543210987654321';\r\n   Z='197530864219753086421975308642197530864219753086421975308642';\r\nend\r\n","test_suite":"%%\r\nX='98765432109876543210987654321098765432109876543210987654321';\r\nY='98765432109876543210987654321098765432109876543210987654321';\r\nZ='197530864219753086421975308642197530864219753086421975308642';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='6546468768680988454345';\r\nY='5757557542432424209808098908085353545657657';\r\nZ='5757557542432424209814645376854034534112002';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='122';\r\nY='323';\r\nZ='445';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='767678686868667868635435353545';\r\nY='465464643244242424249787979';\r\nZ='768144151511912111059685141524';\r\nassert(isequal(dda(X,Y),Z))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":158,"test_suite_updated_at":"2012-04-08T02:09:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-08T02:09:11.000Z","updated_at":"2026-04-21T10:39:43.000Z","published_at":"2012-04-08T02:09:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImagine you are in 2222 Anno Domini, when everyone must learn how to add,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand competing for the highly prestigious post of,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChief Comptroller of Dda Corporation.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are being tested via\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Cody\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for addition of two positive integers X and Y,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand delivered as ASCII strings.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease output the result Z in similar style.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease adopt a general strategy, as X and Y may be changed later.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease rename the function Z = dda(X,Y).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFunction Template:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[function Z = dda(X,Y)\\n   X='98765432109876543210987654321098765432109876543210987654321'\\n   Y='98765432109876543210987654321098765432109876543210987654321'\\n   Z='197530864219753086421975308642197530864219753086421975308642';\\nend]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"problems":[{"id":563,"title":"How to add?","description":"* Imagine you are in 2222 Anno Domini, when everyone must learn how to add,\r\n* and competing for the highly prestigious post of,\r\n* Chief Comptroller of Dda Corporation.\r\n* You are being tested via \u003chttp://www.mathworks.com/matlabcentral/cody MATLAB Cody\u003e for addition of two positive integers X and Y,\r\n* both are fortunately in decimal system, and only a few dozen digits or less, \r\n* and delivered as ASCII strings.\r\n* Please output the result Z in similar style.\r\n* Please adopt a general strategy, as X and Y may be changed later.\r\n* Please rename the function Z = dda(X,Y).\r\n* Function Template:\r\n    \r\n  function Z = dda(X,Y)\r\n     X='98765432109876543210987654321098765432109876543210987654321'\r\n     Y='98765432109876543210987654321098765432109876543210987654321'\r\n     Z='197530864219753086421975308642197530864219753086421975308642';\r\n  end\r\n","description_html":"\u003cul\u003e\u003cli\u003eImagine you are in 2222 Anno Domini, when everyone must learn how to add,\u003c/li\u003e\u003cli\u003eand competing for the highly prestigious post of,\u003c/li\u003e\u003cli\u003eChief Comptroller of Dda Corporation.\u003c/li\u003e\u003cli\u003eYou are being tested via \u003ca href=\"http://www.mathworks.com/matlabcentral/cody\"\u003eMATLAB Cody\u003c/a\u003e for addition of two positive integers X and Y,\u003c/li\u003e\u003cli\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\u003c/li\u003e\u003cli\u003eand delivered as ASCII strings.\u003c/li\u003e\u003cli\u003ePlease output the result Z in similar style.\u003c/li\u003e\u003cli\u003ePlease adopt a general strategy, as X and Y may be changed later.\u003c/li\u003e\u003cli\u003ePlease rename the function Z = dda(X,Y).\u003c/li\u003e\u003cli\u003eFunction Template:\u003c/li\u003e\u003c/ul\u003e\u003cpre class=\"language-matlab\"\u003efunction Z = dda(X,Y)\r\n   X='98765432109876543210987654321098765432109876543210987654321'\r\n   Y='98765432109876543210987654321098765432109876543210987654321'\r\n   Z='197530864219753086421975308642197530864219753086421975308642';\r\nend\r\n\u003c/pre\u003e","function_template":"function Z = dda(X,Y)\r\n   X='98765432109876543210987654321098765432109876543210987654321';\r\n   Y='98765432109876543210987654321098765432109876543210987654321';\r\n   Z='197530864219753086421975308642197530864219753086421975308642';\r\nend\r\n","test_suite":"%%\r\nX='98765432109876543210987654321098765432109876543210987654321';\r\nY='98765432109876543210987654321098765432109876543210987654321';\r\nZ='197530864219753086421975308642197530864219753086421975308642';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='6546468768680988454345';\r\nY='5757557542432424209808098908085353545657657';\r\nZ='5757557542432424209814645376854034534112002';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='122';\r\nY='323';\r\nZ='445';\r\nassert(isequal(dda(X,Y),Z))\r\n\r\n%%\r\nX='767678686868667868635435353545';\r\nY='465464643244242424249787979';\r\nZ='768144151511912111059685141524';\r\nassert(isequal(dda(X,Y),Z))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":3,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":158,"test_suite_updated_at":"2012-04-08T02:09:11.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-04-08T02:09:11.000Z","updated_at":"2026-04-21T10:39:43.000Z","published_at":"2012-04-08T02:09:11.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImagine you are in 2222 Anno Domini, when everyone must learn how to add,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand competing for the highly prestigious post of,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eChief Comptroller of Dda Corporation.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are being tested via\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.com/matlabcentral/cody\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMATLAB Cody\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for addition of two positive integers X and Y,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eboth are fortunately in decimal system, and only a few dozen digits or less,\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eand delivered as ASCII strings.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease output the result Z in similar style.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease adopt a general strategy, as X and Y may be changed later.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease rename the function Z = dda(X,Y).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFunction Template:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[function Z = dda(X,Y)\\n   X='98765432109876543210987654321098765432109876543210987654321'\\n   Y='98765432109876543210987654321098765432109876543210987654321'\\n   Z='197530864219753086421975308642197530864219753086421975308642';\\nend]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"errors":[],"facets":[[{"value":"Big Numbers","count":1,"selected":false}],[{"value":"medium","count":1,"selected":false}]],"term":"tag:\"long\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}