{"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":52522,"title":"Easy Sequences 4: Eliminate the Days of Confusion","description":"If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \"05-02-1998\", may mean either \"May 02, 1998\" or \"February 05, 1998\". However, since there are only 12 months in a year, not all dates are confusing. \"23-10-1969\" is clearly \"October 23, 1969\".\r\nWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing on either \"dd-mm-yyyy\" or \"mm-dd-yyyy\" formats.\r\nTo avoid further confusion you are given the input in \"yyyy-mm-dd\" date format.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eIf a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \"05-02-1998\", may mean either \"May 02, 1998\" or \"February 05, 1998\". However, since there are only 12 months in a year, not all dates are confusing. \"23-10-1969\" is clearly \"October 23, 1969\".\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e on either \"dd-mm-yyyy\" or \"mm-dd-yyyy\" formats.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eTo avoid further confusion you are given the input in \"yyyy-mm-dd\" date format.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function d = noneConfusingDays(minD,maxD)\r\n    d = maxD - minD;\r\nend","test_suite":"%%\r\nminD = '2021-05-21';\r\nmaxD = '2021-08-10';\r\nd_correct = 51;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1999-01-01';\r\nmaxD = '2000-12-20';\r\nd_correct = 456;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1963-11-22';\r\nmaxD = '2021-06-04';\r\nd_correct = 13421;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '2004-07-07';\r\nmaxD = '2005-10-11';\r\nd_correct = 293;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1945-02-14';\r\nmaxD = '2020-05-25';\r\nd_correct = 17562;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":24,"test_suite_updated_at":"2021-08-13T06:44:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-11T19:22:07.000Z","updated_at":"2026-05-24T18:14:31.000Z","published_at":"2021-08-13T06:44:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\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=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \\\"05-02-1998\\\", may mean either \\\"May 02, 1998\\\" or \\\"February 05, 1998\\\". However, since there are only 12 months in a year, not all dates are confusing. \\\"23-10-1969\\\" is clearly \\\"October 23, 1969\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e on either \\\"dd-mm-yyyy\\\" or \\\"mm-dd-yyyy\\\" formats.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo avoid further confusion you are given the input in \\\"yyyy-mm-dd\\\" date format.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"problem_search":{"problems":[{"id":52522,"title":"Easy Sequences 4: Eliminate the Days of Confusion","description":"If a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \"05-02-1998\", may mean either \"May 02, 1998\" or \"February 05, 1998\". However, since there are only 12 months in a year, not all dates are confusing. \"23-10-1969\" is clearly \"October 23, 1969\".\r\nWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing on either \"dd-mm-yyyy\" or \"mm-dd-yyyy\" formats.\r\nTo avoid further confusion you are given the input in \"yyyy-mm-dd\" date format.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.440000534057617px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: normal; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 144px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eIf a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \"05-02-1998\", may mean either \"May 02, 1998\" or \"February 05, 1998\". However, since there are only 12 months in a year, not all dates are confusing. \"23-10-1969\" is clearly \"October 23, 1969\".\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"font-weight: bold; \"\u003eWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003e on either \"dd-mm-yyyy\" or \"mm-dd-yyyy\" formats.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; \"\u003e\u003cspan style=\"\"\u003eTo avoid further confusion you are given the input in \"yyyy-mm-dd\" date format.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function d = noneConfusingDays(minD,maxD)\r\n    d = maxD - minD;\r\nend","test_suite":"%%\r\nminD = '2021-05-21';\r\nmaxD = '2021-08-10';\r\nd_correct = 51;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1999-01-01';\r\nmaxD = '2000-12-20';\r\nd_correct = 456;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1963-11-22';\r\nmaxD = '2021-06-04';\r\nd_correct = 13421;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '2004-07-07';\r\nmaxD = '2005-10-11';\r\nd_correct = 293;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n\r\n%%\r\nminD = '1945-02-14';\r\nmaxD = '2020-05-25';\r\nd_correct = 17562;\r\nassert(isequal(noneConfusingDays(minD,maxD),d_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":255988,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":24,"test_suite_updated_at":"2021-08-13T06:44:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2021-08-11T19:22:07.000Z","updated_at":"2026-05-24T18:14:31.000Z","published_at":"2021-08-13T06:44:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\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=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a date is written in purely numeric format some dates can be confusing, if we don't know the date format used. For example, \\\"05-02-1998\\\", may mean either \\\"May 02, 1998\\\" or \\\"February 05, 1998\\\". However, since there are only 12 months in a year, not all dates are confusing. \\\"23-10-1969\\\" is clearly \\\"October 23, 1969\\\".\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eWrite a program that will count the number of days between two dates (inclusive) that are NOT confusing\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e on either \\\"dd-mm-yyyy\\\" or \\\"mm-dd-yyyy\\\" formats.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo avoid further confusion you are given the input in \\\"yyyy-mm-dd\\\" date format.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"}],"errors":[],"facets":[[{"value":"Easy Sequences Volume I","count":1,"selected":false}],[{"value":"medium","count":1,"selected":false}]],"term":"tag:\"date and time\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}