{"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":45218,"title":"Find a common edge","description":"First input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct integers always sorted in ascending order, ie e1 \u003c e2 ). The goal of this function is to find and return the indices of the rows in the list which contain this particular edge. Output format can be either a column or a row vector.\r\nFor example if inputs are\r\nT = [1 2 3 ;\r\n     1 3 4 ;\r\n     1 4 2 ;\r\n     2 3 4]\r\nand\r\ne = [2 3]\r\nthe output is the vector\r\nrow_idx = [1 4]\r\nsince [2 3] is contained in rows number 1 and 4 of T. With the same input T, but with e = [2 4] this time, the output is the vector row_idx = [3 4], since [2 4] is contained in rows number 3 and 4 of T (Note that edge [b a] is the same as edge [a b] so must be the corresponding outputs). If the edge is not in the list, the function must of course return the empty set.\r\n\r\nSee also\r\nMesh generation\r\nMesh processing toolbox","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 500.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 250.3px; transform-origin: 408px 250.3px; 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; perspective-origin: 385px 31.5px; text-align: left; transform-origin: 385px 31.5px; white-space-collapse: preserve; 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; perspective-origin: 377.083px 8px; transform-origin: 377.083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFirst input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct integers always sorted in ascending order, ie\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; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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; perspective-origin: 23.5417px 8px; transform-origin: 23.5417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ee1 \u0026lt; e2\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; perspective-origin: 247.358px 8px; transform-origin: 247.358px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e ). The goal of this function is to find and return the indices of the rows in the list which contain this particular edge. Output format can be either a column or a row vector.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 77.0167px 8px; transform-origin: 77.0167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example if inputs are\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 405px 40.8667px; transform-origin: 405px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 46.2px 8.5px; tab-size: 4; transform-origin: 46.2px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eT = [1 2 3 ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 46.2px 8.5px; tab-size: 4; transform-origin: 46.2px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1 3 4 ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 46.2px 8.5px; tab-size: 4; transform-origin: 46.2px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1 4 2 ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 42.35px 8.5px; tab-size: 4; transform-origin: 42.35px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     2 3 4]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 405px 10.2167px; transform-origin: 405px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 34.65px 8.5px; tab-size: 4; transform-origin: 34.65px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ee = [2 3]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 70.7833px 8px; transform-origin: 70.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethe output is the vector\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 405px 10.2167px; transform-origin: 405px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 57.75px 8.5px; tab-size: 4; transform-origin: 57.75px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003erow_idx = [1 4]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 385px 31.5px; text-align: left; transform-origin: 385px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 369.667px 8px; transform-origin: 369.667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince [2 3] is contained in rows number 1 and 4 of T. With the same input T, but with e = [2 4] this time, the output is the vector row_idx = [3 4], since [2 4] is contained in rows number 3 and 4 of T (Note that\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; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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; perspective-origin: 117.825px 8px; transform-origin: 117.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eedge [b a] is the same as edge [a b]\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; perspective-origin: 1.725px 8px; transform-origin: 1.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e so must be the corresponding outputs). If the edge is not in the list, the function must of course return the empty set.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95796\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMesh generation\u003c/span\u003e\u003c/span\u003e\u003c/a\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/fileexchange/77004-mesh-processing-toolbox?s_tid=srchtitle\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMesh processing toolbox\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function row_idx = find_common_edge(T,e)\r\n  row_idx = e;\r\nend","test_suite":"%% Tetrahedron 1\r\nT = [1 2 3;...\r\n     1 3 4;...\r\n     1 4 2;...\r\n     2 3 4];\r\n\r\ne = [2 3];\r\nrow_idx = [1 4];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Tetrahedron 2\r\nT = [1 2 3;...\r\n     1 3 4;...\r\n     1 4 2;...\r\n     2 3 4];\r\n\r\ne = [2 4];\r\nrow_idx = [3 4];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Octahedron\r\nT = [1 2 3;...\r\n     1 3 4;...\r\n     1 4 5;...\r\n     1 5 2;...\r\n     6 3 2;...\r\n     6 4 3;...\r\n     6 5 4;...\r\n     6 2 5];\r\n\r\ne = [1 5];\r\nrow_idx = [3 4];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Triangulated cube\r\nT = [1 2 4;...\r\n    2 3 4;...\r\n    5 6 8;...\r\n    6 7 8;...\r\n    1 2 5;...\r\n    2 5 6;...\r\n    2 3 6;...\r\n    3 6 7;...\r\n    3 4 7;...\r\n    4 7 8;...\r\n    4 1 8;...\r\n    1 8 5];\r\n\r\ne = [6 7];\r\nrow_idx = [4 8];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Empty set test\r\nT = [2 3 5;...\r\n     3 5 7;...\r\n     5 7 11;...\r\n     7 11 13];\r\n\r\ne = [6 28];\r\n\r\nassert(isempty(find_common_edge(T,e)))\r\n\r\n\r\n%% Forbidden functions\r\nfiletext = fileread('find_common_edge.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T07:50:32.000Z","deleted_by":null,"deleted_at":null,"solvers_count":44,"test_suite_updated_at":"2025-07-09T05:45:58.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-01T17:21:36.000Z","updated_at":"2026-05-24T23:29:26.000Z","published_at":"2019-12-01T18:01:01.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eFirst input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct integers always sorted in ascending order, ie\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ee1 \u0026lt; e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ). The goal of this function is to find and return the indices of the rows in the list which contain this particular edge. Output format can be either a column or a row vector.\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\u003eFor example if inputs are\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[T = [1 2 3 ;\\n     1 3 4 ;\\n     1 4 2 ;\\n     2 3 4]]]\u003e\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\u003eand\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[e = [2 3]]]\u003e\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\u003ethe output is the vector\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[row_idx = [1 4]]]\u003e\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\u003esince [2 3] is contained in rows number 1 and 4 of T. With the same input T, but with e = [2 4] this time, the output is the vector row_idx = [3 4], since [2 4] is contained in rows number 3 and 4 of T (Note that\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eedge [b a] is the same as edge [a b]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e so must be the corresponding outputs). If the edge is not in the list, the function must of course return the empty set.\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\u003e\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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95796\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMesh generation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/fileexchange/77004-mesh-processing-toolbox?s_tid=srchtitle\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMesh processing toolbox\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":50574,"title":"Number Puzzle - 093","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 20.9091px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 10.4545px; transform-origin: 406.996px 10.4545px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 383.991px 10.4545px; text-align: left; transform-origin: 383.999px 10.4545px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGive a set of three numbers \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, and \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e such that concatenating a^2, b^2, and c^2 gives a square number.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y=puzzle_093()\r\n  y=[1 2 3];\r\nend","test_suite":"%%\r\ny=puzzle_093();\r\ny=y.^2;\r\naa=strcat(num2str(y(1)),num2str(y(2)),num2str(y(3)));\r\na=str2num(aa);\r\nassert(isequal(length(unique(y)),3))\r\nassert(isequal(floor(sqrt(a)),ceil(sqrt(a))))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-02-26T00:40:45.000Z","updated_at":"2026-05-02T21:50:57.000Z","published_at":"2021-02-26T00:40:45.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\u003eGive a set of three numbers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e such that concatenating a^2, b^2, and c^2 gives a square number.\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\"}]}"},{"id":51297,"title":"Number Puzzle - 106","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 41.8182px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 20.9091px; transform-origin: 406.996px 20.9091px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 383.991px 20.9091px; text-align: left; transform-origin: 383.999px 20.9091px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eLet \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e be an integer and \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e is equal to \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea+1\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. Let \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e be an integer formed by concatenating \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e and \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. Give examples of three unique \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e for which \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eis a square. Give your answer in the following form y=[c1 c2 c3].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = puzzle_106()\r\n  y = [1 2 3];\r\nend","test_suite":"%%\r\ny=puzzle_106();\r\nassert(isequal(length(unique(y)),3))\r\nfor i=1:3\r\n   a=num2str(y(i));\r\n   b=num2str(y(i)+1);\r\n   c=str2num(strcat(a,b));\r\n   assert(isequal(sqrt(c),floor(sqrt(c))))\r\nend\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-04-05T18:47:05.000Z","updated_at":"2026-05-03T18:39:06.000Z","published_at":"2021-04-05T18:48:10.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\u003eLet \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be an integer and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is equal to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea+1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Let \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be an integer formed by concatenating \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Give examples of three unique \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for which \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eis a square. Give your answer in the following form y=[c1 c2 c3].\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\"}]}"},{"id":2629,"title":"Check transmitted data follow even parity (True or false) ","description":"Check transmitted data follow even parity (True or false) \r\n\r\n\u003chttp://en.wikipedia.org/wiki/Parity_bit/ Parity Bit\u003e\r\n\r\nSay, '0101', follow even parity because number of 1 are even, answer is true. \r\n\r\n\r\n'0111', it has 3 one, answer is false. \r\n","description_html":"\u003cp\u003eCheck transmitted data follow even parity (True or false)\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Parity_bit/\"\u003eParity Bit\u003c/a\u003e\u003c/p\u003e\u003cp\u003eSay, '0101', follow even parity because number of 1 are even, answer is true.\u003c/p\u003e\u003cp\u003e'0111', it has 3 one, answer is false.\u003c/p\u003e","function_template":"function y = even_parity(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '0101';\r\ny_correct = 1;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '0100';\r\ny_correct = 0;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '0111';\r\ny_correct = 0;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '1111';\r\ny_correct = 1;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '0000';\r\ny_correct = 1;\r\nassert(isequal(even_parity(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-10-13T14:15:24.000Z","updated_at":"2026-05-11T01:29:01.000Z","published_at":"2014-10-13T14:15:23.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck transmitted data follow even parity (True or false)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Parity_bit/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eParity Bit\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSay, '0101', follow even parity because number of 1 are even, answer is true.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e'0111', it has 3 one, answer is false.\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\"}]}"},{"id":2007,"title":"Swap two numbers","description":"Example \r\n\r\nInput:\r\n\r\n a = 10\r\n b = 20\r\n\r\nOutput\r\n\r\n a = 20\r\n b = 10\r\n","description_html":"\u003cp\u003eExample\u003c/p\u003e\u003cp\u003eInput:\u003c/p\u003e\u003cpre\u003e a = 10\r\n b = 20\u003c/pre\u003e\u003cp\u003eOutput\u003c/p\u003e\u003cpre\u003e a = 20\r\n b = 10\u003c/pre\u003e","function_template":"function [aOut,bOut] = swapit(aIn,bIn)\r\n  aOut = 0;\r\n  bOut = 0;\r\nend","test_suite":"%%\r\naIn = 10;\r\nbIn = 20;\r\naOut_correct = 20;\r\nbOut_correct = 10;\r\n[aOut,bOut] = swapit(aIn,bIn);\r\n\r\nassert(isequal(aOut, aOut_correct))\r\nassert(isequal(bOut, bOut_correct))\r\n\r\n%%\r\n\r\naIn = 0;\r\nbIn = -3;\r\naOut_correct = -3;\r\nbOut_correct = 0;\r\n[aOut,bOut] = swapit(aIn,bIn);\r\n\r\nassert(isequal(aOut, aOut_correct))\r\nassert(isequal(bOut, bOut_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":3,"created_by":1388,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":785,"test_suite_updated_at":"2013-11-20T16:20:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-11-19T07:42:21.000Z","updated_at":"2026-05-19T06:38:53.000Z","published_at":"2013-11-19T07:42:21.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput:\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[ a = 10\\n b = 20]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput\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[ a = 20\\n b = 10]]\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\"}]}"},{"id":2479,"title":"Mongean Shuffle","description":"A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.\r\n\r\n* The top card of the deck is taken and put on the right hand side. \r\n* The second card from the deck on left is taken and put on top of right deck. \r\n* The third card is taken from the left and and put at the bottom of the right deck.\r\n* The fourth card is put on top of right deck.\r\n* The fifth card is put at the bottom of right deck.\r\n\r\nThis process is continued until all the cards on left are transferred to the right.\r\n\r\nThe initial state of the cards will be given. Return the state after this shuffle.","description_html":"\u003cp\u003eA Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.\u003c/p\u003e\u003cul\u003e\u003cli\u003eThe top card of the deck is taken and put on the right hand side.\u003c/li\u003e\u003cli\u003eThe second card from the deck on left is taken and put on top of right deck.\u003c/li\u003e\u003cli\u003eThe third card is taken from the left and and put at the bottom of the right deck.\u003c/li\u003e\u003cli\u003eThe fourth card is put on top of right deck.\u003c/li\u003e\u003cli\u003eThe fifth card is put at the bottom of right deck.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThis process is continued until all the cards on left are transferred to the right.\u003c/p\u003e\u003cp\u003eThe initial state of the cards will be given. Return the state after this shuffle.\u003c/p\u003e","function_template":"function y = mshuffle(x)\r\n\r\n\r\nend","test_suite":"%%\r\n% trivial\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(mshuffle(x),y_correct))\r\n\r\n%%\r\nx = 1:5;\r\ny_correct = [4     2     1     3     5];\r\nassert(isequal(mshuffle(x),y_correct))\r\n\r\n\r\n%%\r\na = magic(5);\r\na=a(:)';\r\ny_correct = [3    16     2    20     8    19     7    18     6    24    10    23    17     4    11     5    12     1    13    25    14    21    15    22     9];\r\nassert(isequal(mshuffle(a),y_correct));\r\n\r\n\r\n%%\r\nx = 7:-1:1;\r\ny_correct = [2     4     6     7     5     3     1];\r\nassert(isequal(mshuffle(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":17203,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":15,"created_at":"2014-08-04T10:33:51.000Z","updated_at":"2026-05-06T12:09:25.000Z","published_at":"2014-08-04T10:33:51.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.\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\u003eThe top card of the deck is taken and put on the right hand side.\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\u003eThe second card from the deck on left is taken and put on top of right deck.\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\u003eThe third card is taken from the left and and put at the bottom of the right deck.\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\u003eThe fourth card is put on top of right deck.\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\u003eThe fifth card is put at the bottom of right deck.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis process is continued until all the cards on left are transferred to the right.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe initial state of the cards will be given. Return the state after this shuffle.\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\"}]}"},{"id":48690,"title":"Laws of motion 4","description":"Given the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 284.5px 8px; transform-origin: 284.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = your_fcn_name(u,v,a)\r\n  y = x;\r\nend","test_suite":"%%\r\nu=0\r\nv=1;\r\na=1;\r\ny_correct = 0.5;\r\nassert(isequal(your_fcn_name(u,v,a),y_correct))\r\n\r\n%%\r\nu=0\r\nv=10;\r\na=1;\r\ny_correct = 50;\r\nassert(isequal(your_fcn_name(u,v,a),y_correct))\r\n\r\n%%\r\nu=20\r\nv=100;\r\na=1;\r\ny_correct = 4800;\r\nassert(isequal(your_fcn_name(u,v,a),y_correct))\r\n","published":true,"deleted":false,"likes_count":10,"comments_count":5,"created_by":644918,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2631,"test_suite_updated_at":"2021-02-01T10:35:57.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-21T17:03:05.000Z","updated_at":"2026-05-26T12:09:02.000Z","published_at":"2020-12-21T17:03:05.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\u003eGiven the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.\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\"}]}"},{"id":44862,"title":"Ratio between sum of primes and sum of factors","description":"Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of x.","description_html":"\u003cp\u003eWrite a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of x.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 8;\r\ny_correct = 17/6;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 12;\r\ny_correct = 28/7;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 100;\r\ny_correct = 1060/14;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":274816,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":"2019-03-12T22:32:41.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2019-03-01T22:35:36.000Z","updated_at":"2026-04-20T13:42:48.000Z","published_at":"2019-03-01T22:35:36.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of x.\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\"}]}"},{"id":45337,"title":"Area-03","description":"There are two circles of equal size are inscribed inside a square. They are tangent to each other.\r\n\r\n\u003chttps://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\u003e\r\n\r\nGiven the side length of the square, find the radius of the circles.","description_html":"\u003cp\u003eThere are two circles of equal size are inscribed inside a square. They are tangent to each other.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\"\u003ehttps://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\u003c/a\u003e\u003c/p\u003e\u003cp\u003eGiven the side length of the square, find the radius of the circles.\u003c/p\u003e","function_template":"function y =inscribed_circle_3(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\ny_correct = .2929;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = 10;\r\ny_correct = 2.9289;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = 23.6;\r\ny_correct = 6.9123;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = 0;\r\ny_correct = 0;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = pi;\r\ny_correct = 0.9202;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-17T06:35:50.000Z","updated_at":"2026-04-16T13:09:43.000Z","published_at":"2020-02-17T06:36:40.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere are two circles of equal size are inscribed inside a square. They are tangent to each other.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the side length of the square, find the radius of the circles.\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\"}]}"},{"id":42823,"title":"Babylonian method","description":"Calculate the square root of a given positive number a using the Babylonian method\r\n(https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method).\r\nUse 1 as starting point and calculate the nth iteration step!\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eCalculate the square root of a given positive number a using the Babylonian method\r\n(https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method).\r\nUse 1 as starting point and calculate the nth iteration step!\u003c/p\u003e","function_template":"function y = Babylonian(a,n)\r\n  y = x;\r\nend","test_suite":"%%\r\na=1;\r\nn=1;\r\ny_correct=1;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=10;\r\nn=1;\r\ny_correct=1;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=2;\r\nn=10;\r\ny_correct=1.4142;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=4;\r\nn=10;\r\ny_correct=2;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=0.25;\r\nn=10;\r\ny_correct=0.5;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=30;\r\nn=4;\r\ny_correct=6.0795;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":73322,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":46,"test_suite_updated_at":"2016-04-24T17:03:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-04-24T17:01:50.000Z","updated_at":"2026-04-14T12:32:35.000Z","published_at":"2016-04-24T17:01:50.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the square root of a given positive number a using the Babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method). Use 1 as starting point and calculate the nth iteration step!\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\"}]}"},{"id":46848,"title":"Modulo of sum of square of first n primes with 24","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 199.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 99.8px; transform-origin: 407px 99.8px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the modulo of sum of square of first n primes with 24.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e For n = 1,  mod(2^2,24) = 4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e For n = 2, mod(2^2 + 3^2,24) = 13\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e For n = 4, mod(2^2 + 3^2 + 5^2 + 7^2,24) = 15\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eNote: n can be very large.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHint : refer tag or check the modulo of square of primes(greater than 3) with 24 to observe the pattern\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = modp24(n)\r\n  %...rather than a brute force approach, try finding a pattern in primes square and 24 :)\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 4;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 13;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 4;\r\ny_correct = 15;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 15;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 120;\r\ny_correct = 11;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 1000;\r\ny_correct = 3;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 10^9;\r\ny_correct = 3;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 10^12 + 15;\r\ny_correct = 18;\r\nassert(isequal(modp24(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":442401,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2020-10-17T08:26:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-17T08:22:52.000Z","updated_at":"2026-04-14T12:35:26.000Z","published_at":"2020-10-17T08:26:39.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\u003eFind the modulo of sum of square of first n primes with 24.\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\u003eExample:\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\u003e For n = 1,  mod(2^2,24) = 4\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\u003e For n = 2, mod(2^2 + 3^2,24) = 13\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\u003e For n = 4, mod(2^2 + 3^2 + 5^2 + 7^2,24) = 15\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\u003eNote: n can be very large.\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\u003eHint : refer tag or check the modulo of square of primes(greater than 3) with 24 to observe the pattern\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\"}]}"},{"id":44246,"title":"Delete the column with all 0 in the TABLE","description":"In the given table (T), delete the column with all 0 data.\r\n\r\ne.g.\r\n\r\ninput\r\n\r\n\r\n    Banana    Apple    Orange    Mellon\r\n    ______    _____    ______    ______\r\n\r\n    0         71       0          2    \r\n    0          5       0          4    \r\n    0         64       0         34  \r\n  \r\noutput\r\n\r\n    Apple    Mellon\r\n    _____    ______\r\n\r\n    71        2    \r\n     5        4    \r\n    64       34   ","description_html":"\u003cp\u003eIn the given table (T), delete the column with all 0 data.\u003c/p\u003e\u003cp\u003ee.g.\u003c/p\u003e\u003cp\u003einput\u003c/p\u003e\u003cpre\u003e    Banana    Apple    Orange    Mellon\r\n    ______    _____    ______    ______\u003c/pre\u003e\u003cpre\u003e    0         71       0          2    \r\n    0          5       0          4    \r\n    0         64       0         34  \u003c/pre\u003e\u003cp\u003eoutput\u003c/p\u003e\u003cpre\u003e    Apple    Mellon\r\n    _____    ______\u003c/pre\u003e\u003cpre\u003e    71        2    \r\n     5        4    \r\n    64       34   \u003c/pre\u003e","function_template":"function newT = myTable(T)\r\n  newT = T;\r\nend","test_suite":"%% 1\r\nBanana = [0;0;0];\r\nApple = [71;5;64];\r\nOrange = [0;0;0];\r\nMellon= [2;4;34];\r\nT = table(Banana,Apple,Orange,Mellon);\r\n\r\nT_correct =table(Apple,Mellon) ;\r\nassert(isequal(myTable(T),T_correct))\r\n\r\n\r\n%% 2\r\nTulip = [0;43;38;40;49];\r\nLily = [71;0;64;67;64];\r\nAmaryllis = [5;163;131;0;70];\r\nHyacinth= [0; 0 ; 0 ; 0 ; 0 ];\r\nCrocus = [124; 0 ; 4 ; 3 ; 122 ];\r\n\r\nT = table(Tulip,Lily,Amaryllis,Hyacinth,Crocus);\r\nT_correct =table(Tulip,Lily,Amaryllis,Crocus) ;\r\nassert(isequal(myTable(T),T_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-02T08:12:31.000Z","updated_at":"2026-04-12T01:17:01.000Z","published_at":"2017-07-02T09:15:34.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the given table (T), delete the column with all 0 data.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ee.g.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput\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[    Banana    Apple    Orange    Mellon\\n    ______    _____    ______    ______\\n\\n    0         71       0          2    \\n    0          5       0          4    \\n    0         64       0         34]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput\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[    Apple    Mellon\\n    _____    ______\\n\\n    71        2    \\n     5        4    \\n    64       34]]\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\"}]}"},{"id":44472,"title":"A kind of decryption","description":"Please convert the vector to letters by referring to the examples below.\r\n\r\n(eg.1) input vec=[34 1 59] \u003e\u003e\u003e output s='A Z'\r\n\r\n(eg.2) input vec=[66 1 67 1 68] \u003e\u003e\u003e output s='a b c'","description_html":"\u003cp\u003ePlease convert the vector to letters by referring to the examples below.\u003c/p\u003e\u003cp\u003e(eg.1) input vec=[34 1 59] \u0026gt;\u0026gt;\u0026gt; output s='A Z'\u003c/p\u003e\u003cp\u003e(eg.2) input vec=[66 1 67 1 68] \u0026gt;\u0026gt;\u0026gt; output s='a b c'\u003c/p\u003e","function_template":"function s = decryp(vec)\r\n  s='';\r\nend","test_suite":"%% 1\r\nx = [19 17 18 25];\r\ny_correct = '2018';\r\nassert(isequal(decryp(x),y_correct))\r\n%% 2\r\nx = [46 34 53 45 34 35];\r\ny_correct = 'MATLAB';\r\nassert(isequal(decryp(x),y_correct))\r\n%% 3\r\nx = [34 1 41 66 81 81 90 1 47 70 88 1 58 70 66 83 1 2 2];\r\ny_correct = 'A Happy New Year !!';\r\nassert(isequal(decryp(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":137687,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-26T03:18:52.000Z","updated_at":"2026-04-28T09:39:14.000Z","published_at":"2017-12-26T03:49:45.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease convert the vector to letters by referring to the examples below.\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\u003e(eg.1) input vec=[34 1 59] \u0026gt;\u0026gt;\u0026gt; output s='A Z'\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\u003e(eg.2) input vec=[66 1 67 1 68] \u0026gt;\u0026gt;\u0026gt; output s='a b c'\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\"}]}"},{"id":3010,"title":"Self-similarity 1 - Every other term","description":"Self-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the \u003chttps://oeis.org/selfsimilar.html OEIS page\u003e for more information.\r\n\r\nIn this problem, you are to check if the sequence is self-similar by every other term. The problem set assumes that you use the easiest route: take the first element and then every other element thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.\r\n\r\nFor example,\r\n\r\n* seq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]\r\n* seq_every_other = [0,  ,  1, , 1, , 2, , 1, , 2, , 2, , 3, ,] (extra commas are instructional and should not be in the every-other series) \r\n* seq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3]\r\n\r\nSince seq_every_other = seq_orig_first_half, the set is self-similar.\r\n\r\nThis problem is related to \u003chttps://www.mathworks.com/matlabcentral/cody/problems/3011-self-similarity-2-every-third-term Problem 3011\u003e and \u003chttps://www.mathworks.com/matlabcentral/cody/problems/3012-self-similarity-3-every-other-pair-of-terms Problem 3012\u003e.","description_html":"\u003cp\u003eSelf-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the \u003ca href = \"https://oeis.org/selfsimilar.html\"\u003eOEIS page\u003c/a\u003e for more information.\u003c/p\u003e\u003cp\u003eIn this problem, you are to check if the sequence is self-similar by every other term. The problem set assumes that you use the easiest route: take the first element and then every other element thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.\u003c/p\u003e\u003cp\u003eFor example,\u003c/p\u003e\u003cul\u003e\u003cli\u003eseq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]\u003c/li\u003e\u003cli\u003eseq_every_other = [0,  ,  1, , 1, , 2, , 1, , 2, , 2, , 3, ,] (extra commas are instructional and should not be in the every-other series)\u003c/li\u003e\u003cli\u003eseq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3]\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eSince seq_every_other = seq_orig_first_half, the set is self-similar.\u003c/p\u003e\u003cp\u003eThis problem is related to \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/3011-self-similarity-2-every-third-term\"\u003eProblem 3011\u003c/a\u003e and \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/3012-self-similarity-3-every-other-pair-of-terms\"\u003eProblem 3012\u003c/a\u003e.\u003c/p\u003e","function_template":"function [tf] = self_similarity_1(seq)\r\n\r\ntf = 0;\r\n\r\nend","test_suite":"%%\r\nseq = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 8, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 2, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 2];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 2, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 8, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 390, 390, 54, 630, 174, 366];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 3, 2, 5, 1, 4, 4, 4, 2, 7, 3, 4, 2, 5, 3, 9, 2, 5, 5, 4, 1, 11, 4, 7, 4, 6, 4, 10, 2, 7, 7, 7, 3, 13, 4, 7, 2, 9, 5, 14, 3, 8, 9, 10, 2, 16, 8, 9, 5, 9, 5, 21, 1, 11, 11, 10, 4, 17, 7, 10, 4, 11, 6, 11, 4, 16, 10, 11, 2, 23, 7, 12, 7, 14, 7, 20, 3];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2, 0, 0, 2, 1, 1, 2, 1, 1, 1, 1, 0, 2, 0, 0, 2, 2, 1, 2, 0, 1, 2, 0, 1, 3, 0, 0, 2, 1, 0, 2, 2, 1, 1, 0, 0, 3, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96, 336, 192, 576, 24, 432, 312, 480, 144, 768, 288, 576, 96, 744, 336, 960, 192, 720, 576, 768, 24, 1152, 432, 1152, 312, 912, 480, 1344, 144, 1008, 768, 1056, 288, 1872, 576, 1152, 96, 1368, 744, 1728, 336];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2, 0, 0, 2, 1, 1, 2, 1, 1, 2, 1, 0, 2, 0, 0, 2, 2, 1, 2, 0, 1, 2, 0, 1, 3, 0, 0, 2, 1, 0, 2, 2, 1, 1, 0, 0, 3, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 2, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 1, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 0, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96, 336, 192, 576, 24, 432, 312, 480, 144, 768, 288, 576, 96, 744, 336, 960, 192, 720, 576, 768, 24, 1152, 432, 1152, 312, 912, 480, 1344, 312, 1008, 768, 1056, 288, 1872, 576, 1152, 96, 1368, 744, 1728, 336];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 4, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 16, 16, 8, 16, 16, 32, 8, 8, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 318, 390, 54, 630, 174, 366];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 3, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 3, 2, 5, 1, 4, 4, 4, 2, 7, 3, 4, 2, 5, 3, 9, 2, 5, 5, 5, 1, 11, 4, 7, 4, 6, 4, 10, 2, 7, 7, 7, 3, 13, 4, 7, 2, 9, 5, 14, 3, 8, 9, 10, 2, 16, 5, 9, 5, 9, 5, 21, 1, 11, 11, 10, 4, 17, 7, 10, 4, 11, 6, 18, 4, 16, 10, 11, 2, 23, 7, 12, 7, 14, 7, 20, 3];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 2];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, -1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":30,"created_at":"2015-02-13T04:04:32.000Z","updated_at":"2026-04-24T15:01:30.000Z","published_at":"2015-02-13T04:04:32.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSelf-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the\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=\\\"https://oeis.org/selfsimilar.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOEIS page\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for more information.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn this problem, you are to check if the sequence is self-similar by every other term. The problem set assumes that you use the easiest route: take the first element and then every other element thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example,\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\u003eseq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]\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\u003eseq_every_other = [0, , 1, , 1, , 2, , 1, , 2, , 2, , 3, ,] (extra commas are instructional and should not be in the every-other series)\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\u003eseq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSince seq_every_other = seq_orig_first_half, the set is self-similar.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is related to\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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/3011-self-similarity-2-every-third-term\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 3011\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/3012-self-similarity-3-every-other-pair-of-terms\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 3012\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":61036,"title":"The MATLAB Treasure Hunt – Cross the River of Ratios by Finding Successive Proportions in the Data Stream","description":"Following the glowing script, you arrive at the River of Ratios — a flowing stream of numbers.\r\nA carved message on the rocks reads: “Only those who know the balance between every pair shall cross.”\r\nGiven a numeric vector a, calculate the ratio of each element to the previous one.\r\nReturn a vector r such that r(i) = a(i+1)/a(i) for all valid i.\r\nThis will reveal the rhythm of the river and guide your next step!","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 141px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 70.5px; transform-origin: 408px 70.5px; vertical-align: baseline; \"\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFollowing the glowing script, you arrive at the \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRiver of Ratios\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e — a flowing stream of numbers.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA carved message on the rocks reads: \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e“Only those who know the balance between every pair shall cross.”\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a numeric vector \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, calculate the \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eratio of each element to the previous one\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn a vector \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003er\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e such that \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003er(i) = a(i+1)/a(i)\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for all valid \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ei\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis will reveal the rhythm of the river and guide your next step!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = riverRatios(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = [2 4 8 16];\r\ny_correct = [2 2 2];\r\nassert(isequal(riverRatios(a),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4953963,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-21T09:38:42.000Z","updated_at":"2026-05-26T07:08:26.000Z","published_at":"2025-10-21T09:38:42.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eFollowing the glowing script, you arrive at the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRiver of Ratios\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e — a flowing stream of numbers.\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\u003eA carved message on the rocks reads: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e“Only those who know the balance between every pair shall cross.”\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\u003eGiven a numeric vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, calculate the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eratio of each element to the previous one\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\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\u003eReturn a vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003er\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003er(i) = a(i+1)/a(i)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for all valid \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\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\u003eThis will reveal the rhythm of the river and guide your next step!\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\"}]}"},{"id":61188,"title":"Compute optimal regenerative and friction brake torque blending.","description":"Electric and hybrid vehicles combine regenerative braking with traditional friction braking to maximize energy recovery while ensuring safety.\r\nGiven total braking torque demand and maximum regenerative torque capability, compute how braking effort should be split between regenerative and friction braking.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 383px 21px; text-align: left; transform-origin: 383px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eElectric and hybrid vehicles combine regenerative braking with traditional friction braking to maximize energy recovery while ensuring safety.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 383px 21px; text-align: left; transform-origin: 383px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven total braking torque demand and maximum regenerative torque capability, compute how braking effort should be split between regenerative and friction braking.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [Tregen, Tfric] = brakeBlending(T_total, Tregen_max)\r\nTregen = 0; Tfric = 0;\r\nend\r\n","test_suite":"%%\r\nT_total = 300; Tregen_max = 200;\r\n[Tregen,Tfric] = brakeBlending(T_total,Tregen_max);\r\nassert(isequal([Tregen Tfric],[200 100]))\r\n\r\n%%\r\nT_total = 150; Tregen_max = 200;\r\n[Tregen,Tfric] = brakeBlending(T_total,Tregen_max);\r\nassert(isequal([Tregen Tfric],[150 0]))\r\n\r\n%%\r\nT_total = 0; Tregen_max = 200;\r\n[Tregen,Tfric] = brakeBlending(T_total,Tregen_max);\r\nassert(isequal([Tregen Tfric],[0 0]))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":2305225,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":65,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-02-02T07:28:49.000Z","updated_at":"2026-05-24T19:30:58.000Z","published_at":"2026-02-02T07:28:49.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eElectric and hybrid vehicles combine regenerative braking with traditional friction braking to maximize energy recovery while ensuring safety.\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\u003eGiven total braking torque demand and maximum regenerative torque capability, compute how braking effort should be split between regenerative and friction braking.\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\"}]}"},{"id":47310,"title":"Find Logic 15","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 221.619px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 174px 110.81px; transform-origin: 174px 110.81px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGuess the Logic!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(1) = 1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(2) = 8\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(3) = 9\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(4) = 64\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(5) = 25\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.9048px; 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; perspective-origin: 151px 20.9524px; text-align: left; transform-origin: 151px 20.9524px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMake a function logic(x) which will return 'x' th term of sequence.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = logic(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny_correct = 8;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 25;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 6;\r\ny_correct = 216;\r\nassert(isequal(logic(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":293792,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":457,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-11-05T14:25:25.000Z","updated_at":"2026-05-25T07:16:47.000Z","published_at":"2020-11-05T14:25:25.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\u003eGuess the Logic!\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\u003elogic(1) = 1\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\u003elogic(2) = 8\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\u003elogic(3) = 9\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\u003elogic(4) = 64\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\u003elogic(5) = 25\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\u003eMake a function logic(x) which will return 'x' th term of sequence.\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\"}]}"},{"id":50892,"title":"Draw a '7' in a zero matrix!","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 441px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 220.5px; transform-origin: 407px 220.5px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a x-by-x matrix filled with zeros (x is odd and \u0026gt; 3). Use 7s to draw a number 7 into it! Like this:\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex = 5, y =\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e7\t7\t7\t7\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex = 7, y = \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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e7\t7\t7\t7\t7\t7\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0      7\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = seven(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 5;\r\ny_correct = [7 7 7 7 7;0 0 0 0 7;0 0 0 0 7;0 0 0 0 7;0 0 0 0 7];\r\nassert(isequal(seven(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [7 7 7 7 7 7 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7];\r\nassert(isequal(seven(x),y_correct))\r\n\r\n%%\r\nx = 9;\r\ny_correct = [7 7 7 7 7 7 7 7 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7];\r\nassert(isequal(seven(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":921257,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":674,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-03-10T06:26:49.000Z","updated_at":"2026-05-26T09:33:13.000Z","published_at":"2021-03-10T06:26:49.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\u003eGiven a x-by-x matrix filled with zeros (x is odd and \u0026gt; 3). Use 7s to draw a number 7 into it! Like this:\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\u003ex = 5, y =\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\u003e7\\t7\\t7\\t7\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003ex = 7, y = \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\u003e7\\t7\\t7\\t7\\t7\\t7\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0      7\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\"}]}"},{"id":1443,"title":"Edges of a n-dimensional Hypercube","description":"Return the number of edges on an \u003chttp://en.wikipedia.org/wiki/Hypercube _n_-dimensional hypercube\u003e (with an integer n \u0026ge; 0).\r\n\r\nNeither *string operations* nor *interpolations* are allowed!\r\n","description_html":"\u003cp\u003eReturn the number of edges on an \u003ca href = \"http://en.wikipedia.org/wiki/Hypercube\"\u003e\u003ci\u003en\u003c/i\u003e-dimensional hypercube\u003c/a\u003e (with an integer n \u0026ge; 0).\u003c/p\u003e\u003cp\u003eNeither \u003cb\u003estring operations\u003c/b\u003e nor \u003cb\u003einterpolations\u003c/b\u003e are allowed!\u003c/p\u003e","function_template":"function E = hypercube_edges(n)\r\n  E = n;\r\nend","test_suite":"%%\r\nuser_solution = fileread('hypercube_edges.m');\r\nassert(isempty(strfind(user_solution,'regexp')));\r\nassert(isempty(strfind(user_solution,'2str')));\r\nassert(isempty(strfind(user_solution,'str2')));\r\nassert(isempty(strfind(user_solution,'interp')));\r\nassert(isempty(strfind(user_solution,'printf')));\r\nassert(isempty(strfind(user_solution,'assert')));\r\n\r\n%%\r\nn = 0;\r\nE_correct = 0;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 1;\r\nE_correct = 1;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 2;\r\nE_correct = 4;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 3;\r\nE_correct = 12;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 4;\r\nE_correct = 32;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 5;\r\nE_correct = 80;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 6;\r\nE_correct = 192;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 7;\r\nE_correct = 448;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 8;\r\nE_correct = 1024;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 9;\r\nE_correct = 2304;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 10;\r\nE_correct = 5120;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 11;\r\nE_correct = 11264;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 12;\r\nE_correct = 24576;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 13;\r\nE_correct = 53248;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 14;\r\nE_correct = 114688;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 15;\r\nE_correct = 245760;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":10352,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2013-04-28T07:06:47.000Z","rescore_all_solutions":false,"group_id":20,"created_at":"2013-04-22T11:46:41.000Z","updated_at":"2026-04-27T13:36:56.000Z","published_at":"2013-04-22T11:47:26.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn the number of edges on an\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://en.wikipedia.org/wiki/Hypercube\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e-dimensional hypercube\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (with an integer n ≥ 0).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNeither\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estring operations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e nor\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003einterpolations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e are allowed!\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\"}]}"},{"id":1737,"title":"The sum of individual numbers...","description":"Well this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 (only if the original is 0 the answer will be 0).  For example:\r\n  \r\n  x = [103]; So ---\u003e 1+0+3 = 4\r\n  output  = 4;\r\n\r\nanother example:\r\n\r\n  x = [99]; So ---\u003e 9+9 = 18  ---\u003e 1+8 = 9\r\n  output  = 9;\r\n\r\nanother example:\r\n  \r\n  x = [1199]; So ---\u003e 1+1+9+9 = 20  ---\u003e 2+0 = 2\r\n  output  = 2;\r\n\r\n\r\nanother example:\r\n\r\n  x = [11 3]; So ---\u003e 1+1 = 2 and  3 = 3\r\n  output  = [2 3];\r\n","description_html":"\u003cp\u003eWell this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 (only if the original is 0 the answer will be 0).  For example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [103]; So ---\u003e 1+0+3 = 4\r\noutput  = 4;\r\n\u003c/pre\u003e\u003cp\u003eanother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [99]; So ---\u003e 9+9 = 18  ---\u003e 1+8 = 9\r\noutput  = 9;\r\n\u003c/pre\u003e\u003cp\u003eanother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [1199]; So ---\u003e 1+1+9+9 = 20  ---\u003e 2+0 = 2\r\noutput  = 2;\r\n\u003c/pre\u003e\u003cp\u003eanother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [11 3]; So ---\u003e 1+1 = 2 and  3 = 3\r\noutput  = [2 3];\r\n\u003c/pre\u003e","function_template":"function y = individualNumSum(x)\r\ny = x;\r\nend","test_suite":"%%\r\nx = [1];\r\ny = [1];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx = [103];\r\ny = [4];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[189 22 39 88 55 485 769 215 3685 4589];\r\ny = [9 4 3 7 1 8 4 8 4 8];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[1111 2222 3333 4444 5555 6666 7777 8888 9999 0];\r\ny = [4 8 3 7 2 6 1 5 9 0];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[111 222 333 444 555 666 777 888 999 0];\r\ny = [3 6 9 3 6 9 3 6 9 0];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[11 3];\r\ny = [2 3];\r\nassert(isequal(individualNumSum(x),y))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":15013,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2013-07-22T18:34:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-22T18:22:26.000Z","updated_at":"2026-05-22T08:22:38.000Z","published_at":"2013-07-22T18:34:35.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWell this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 (only if the original is 0 the answer will be 0). For example:\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[x = [103]; So ---\u003e 1+0+3 = 4\\noutput  = 4;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother example:\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[x = [99]; So ---\u003e 9+9 = 18  ---\u003e 1+8 = 9\\noutput  = 9;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother example:\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[x = [1199]; So ---\u003e 1+1+9+9 = 20  ---\u003e 2+0 = 2\\noutput  = 2;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother example:\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[x = [11 3]; So ---\u003e 1+1 = 2 and  3 = 3\\noutput  = [2 3];]]\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\"}]}"},{"id":2793,"title":"Guess","description":"A random number between 1 and 10 is created for the variable y. Guess what its value is.","description_html":"\u003cp\u003eA random number between 1 and 10 is created for the variable y. Guess what its value is.\u003c/p\u003e","function_template":"function y = guess(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = randi(x);\r\nassert(isequal(guess(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":33304,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":90,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-17T14:28:15.000Z","updated_at":"2026-02-18T16:36:34.000Z","published_at":"2014-12-17T14:28:15.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA random number between 1 and 10 is created for the variable y. Guess what its value is.\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\"}]}"},{"id":44882,"title":"Opposite point of the earth, what is the antipodal of a point ?","description":"Given two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u003cnothing\u003e', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\r\n\r\n*Extra question:* What is the opposite point of north pole? And why is not possible to calculate it by this method ?\r\n\r\nSuppose the earth is spherical, not flat (Lol)","description_html":"\u003cp\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExtra question:\u003c/b\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\u003c/p\u003e\u003cp\u003eSuppose the earth is spherical, not flat (Lol)\u003c/p\u003e","function_template":"function [lat_o,long_o] = opposite_earth_point(lat,long)\r\n  [lat_o long_o] = [lat long];\r\nend","test_suite":"%% \r\n%Mathworks headquarters\r\nlat = '42.3 N';\r\nlong = '71.37 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '42.3 S';\r\nlong_o_correct = '108.63 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%% \r\n%San Antonio\r\nlat = '29.31 N';\r\nlong = '98.46 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '29.31 S';\r\nlong_o_correct= '81.54 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%My city \r\nlat = '32.9 S';\r\nlong = '68.82 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '32.9 N';\r\nlong_o_correct = '111.18 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Big Ben \r\nlat = '51.5 N';\r\nlong = '0.12 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '51.5 S';\r\nlong_o_correct = '179.88 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Wellington\r\nlat = '41.27 S';\r\nlong = '174.78 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '41.27 N';\r\nlong_o_correct = '5.22 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Some point of Brasil\r\nlat = '1 S';\r\nlong = '50 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '1 N';\r\nlong_o_correct = '130 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n% Some point near to Moscú\r\nlat = '55 N';\r\nlong = '37 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '55 S';\r\nlong_o_correct = '143 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2019-04-18T18:26:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-04-18T18:22:19.000Z","updated_at":"2026-03-16T13:49:41.000Z","published_at":"2019-04-18T18:22:19.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal). The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). You have to return two strings (lat and long) with the same format that the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExtra question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the earth is spherical, not flat (Lol)\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\"}]}"},{"id":57884,"title":"Find  gradient of a numeric data which has same size as the existing vector.","description":"**** Refer matlab documentation about finding gradient ****\r\nConvert the entire gradient vector to least integer form. (Probably the easiest problem ever)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 25.5px; transform-origin: 407.5px 25.5px; vertical-align: baseline; \"\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; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e**** Refer matlab documentation about finding gradient ****\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; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eConvert the entire gradient vector to least integer form. (Probably the easiest problem ever)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y =gradient_vector(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = [1 1 1 1 1];\r\nassert(isequal(gradient_vector(x),y_correct))\r\n\r\n\r\n%%\r\nx = [82    91    13    92    64    10    28    55    96    97    16    98    96    49    81    15    43    92    80    96];\r\n\r\ny_correct = [9   -35     0    25   -41   -18    22    34    21   -40     0    40   -25    -8   -17   -19    38    18     2    16];\r\nassert(isequal(gradient_vector(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":1809490,"edited_by":1809490,"edited_at":"2023-04-03T05:47:13.000Z","deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-04-03T05:47:05.000Z","updated_at":"2026-03-16T10:43:54.000Z","published_at":"2023-04-03T05:47:13.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003e**** Refer matlab documentation about finding gradient ****\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\u003eConvert the entire gradient vector to least integer form. (Probably the easiest problem ever)\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\"}]}"},{"id":54285,"title":"Palindrome Problem 1","description":"Continued Problem 50033: A palindrome  is one-thirteenth of the sum of  and , where  and  are also palindrome. Give an example of . ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 43.9px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 331.5px 21.95px; transform-origin: 331.5px 21.95px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 308.5px 21.95px; text-align: left; transform-origin: 308.5px 21.95px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eContinued Problem 50033: A palindrome \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e is one-thirteenth of the sum of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAtCAYAAADcMyneAAAAAXNSR0IArs4c6QAAA05JREFUWEft2FvIbVMYBuBnIyWnhAsUEUnkkLBFkTaRnMmZ4gI57NDeOct248ax5OyCnCLHG3HDxaZdXCAhSsohKcohEdGrb2iazf/3/2ux1n+xRq3Wao455nzH+33f+71jLbPEx7Iljs8M4LgRmjE4Y3BcBnrrN8Y5OBcH4Fu8gDvxLv7ov2+SObgZbsfxeAcbYXkB+qxAvz4tgCHiMuyOa/FNAdkJd+FoPIfz8V0X5KQY3AZ34AZ81GNpfzxf147B29MAuA/2wwMDebY1HscKHIy10wA4X61ticewFU7DJ0sN4K54CimQ1fhlqQE8EbfhzH54A3RSRTJXiLfAfVUYt+K3acnMEMANcCW2r9D+NHTTtBjMe0/HIbi6Osogy9MCGGAR5VX4er4SnwbAgLsIKwfAbY4NO51m4kVyIC6odvdFj7n05ivwUhmHv6YnyeC+uLvPUAfkDngTl+DvgpkUwF3waFms+VLuJDz7b0KdHNgOeyO7jiWK0qeProfDcBXS5HMtBiA7zmbTczN3JJ6u3825jGQthxjcDdnxxTgCXyEu40NcU6AjqLFIP9Q9b1UnuBTvIUxsiuPw4kjIatFcIc71G+vzTFXdefgZ91eo0js/xsnYo6NpcSdhfK//E2B2n4Q+u0L4Kbatnhn2Uon34mU8jINwfTF6OF4p13zqgP9bFKFzMbgznqxwxvH+XgCSa8nRW3B5Jf6PuKk0Lc+LY7655pImSYORx1wAGwt5eEo/4W26FSbj3w5F/yzRZT6aljPIWGMIYJeFAEyYc/JqI5UdMY2NT1jDZnMhzdvlrHHUkH1aLNohgLFAD+EEPIJU5vedB7f8+wCn4P3O3LG1mdeqqr9cLKCF2K0uQ2dVONu6tKOELSDzHc37tSbXr9yLO+nPjYxziMHG0LqyRKngNnbEEyUz0chXO3Np9A+W7GRjOQglTz8vORoJZB9gl6FUb/+M0EL4Bs6oImkv3hPRzE1K2POd+68r/fxPALYkj8j2+2I3hLHpkZkIdxsNfMQ7bS5/c6yZz4wuBHGfwfaS/DXRF9lUbYom59cL6yzRfUdyN/KTcU+Fe9DGLwRYu2dSbmYxmP5x7wzgyNTVwhmDMwbHZWDc9bMcHJfBPwHsq6kuL3/DIwAAAABJRU5ErkJggg==\" width=\"20\" height=\"22.5\" style=\"width: 20px; height: 22.5px;\"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAtCAYAAAAgJgIUAAAAAXNSR0IArs4c6QAAArtJREFUWEft11uozWkYx/HPRoRcOYQbh2hSikYxuKBkcuHYKIcc0hBuyJBTIYfBFTlNXGqcb4QLcrggF7iimUxuHEqNEc0FknLqqfe/2/3917b3sv/stN6btVbrXev9vs/z/J7n96/TClZdK2BQg8iyUIvEdx+JDpiIpRiHF7iCvbiK93lFtnRNBMAarMLtdNhQdEkwS3AcHxqCtDTEFCzEctxPB3XH71iEm5iFB2VBdMZuHMG1XMj7pQiMQICeLQuiL37BfrzJQXTCnhSlOThaFkRjE6BjitJs/Iwb3wKiG/7Ea/yK/78FxHCcwlqcKFuiRSkJ2YY6IiWr8eprQ0QLCElOT83rvyLKlu4T+TPGYBl+w6NKlVsmxCBsw3rca0w6ZUEEwA6swz85gKiNrnhc5hQdiE3Yib9zAO2wAA9xqSyIPjiAARVqIObIc8zDv2VAxAGHMO0z5nll6p71k7SoJiJkPTEYP2Jk8gPR+2N/VvHhFS6nsZ1NzKrMexFEhHQCZmJsCttU/IW4xWg8TSGNQ0N+MT2rXo2pYwO24EIqpvlog12IiXkSQxBGJdJQ9aoEEU4oCmwuNiYT0jsBvMVPuIiXiCjdqpog5bjo9z+km/ZPB8druKVs+kV1H05RCtBnZUBMxpnkC++mdGRNp33qASuwFZvxrqUh2qY/j24XK24aTiiTVKQlPkfRhkGpbzrVghTVRGZAQiGnC0xIqON8Uks4pYqDqalQRRDDcA698IkfRKQhFBKKiPfhlr5oFUEsxsEK9ryhajJpBnQY2/ycaDJYHiIzpAEST0zhhBo650w1PTApfRemZXuRY2oqRR4iuuUxjKqQiqiH66mL/pEGVTxxFTqmaiHGpyZ0BzMKzEgMqX2IfWFcQ55PmnpYpX1lmZpmcdUgyjA1zUpBw821dNTSkS+eVlETHwGnQ4IudpkxZgAAAABJRU5ErkJggg==\" width=\"16.5\" height=\"22.5\" style=\"width: 16.5px; height: 22.5px;\"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003em\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e are also palindrome. Give an example of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG0AAAAkCAYAAACDr7TyAAAAAXNSR0IArs4c6QAAB1RJREFUaEPtmnXIrVUWh5/rqDP22BhYjNgtdncrBmMHKhY2dndg1yjOoGK3o3/YiY0tIjKDYisWdgcPrC2bc877vvv9zrn3+snZcBE5+91r7RW/9Vtrf2MYrlFngTGjTuOhwgydNgqDoK3TJgFWBB4BvhuF9/2jqTwBsCrwPPBpqXJtnDY9cCRwMfBqqYDhvkYLzAIcCJwLvNm4G4rhcUbgWOC8ocNKzNp6j/Y9pNRxJZkmJJ4GPAlcC/zaWqXhByUWWB7YEjgU+LrugxKnedAqkcK1h5VoNtxTaYG/AAcD3wSiVSZHk9NmAi4FTg/yMbT52LXAnMC/IkFeqRLV5LSdgZWBvYAvx66+w9MBs+0E4CfgOODnXlapc9pUwL+B+4BLhiYdZxZYMxy3FfBGW6ctAdwcxVESMlzjxgL/AK4Djgdub+u03YDtga1L+4dxc6c/vZSEcNY0IbKLkFTBY8LWuYFdgM//9KYa3AWdckwRtN3apI2nBCYMXvBDg6iJgVOB6aq4RJXTJo1Gz0K4P/BtjSD7uDmAxYBFY8x1NHAv8FdgU2BfwAA4Keisl/Fyq0VfslTIU9mRthVe1umCOgjtywAXAreGHhsAewDKugY4AvhkAL7yjhsCmwDzhx0eAnYAlgT2C5soylGVUyUZuTaoWkcBKwXKfdS5qcpp0wJXA88BHtCTxQTbWQiYN4y/CPB4CLPfOBOYHJg6er1no0a+G7R2DeA9wKL7flzePSNZCwIWcY2lHk/FuaKEjMwx3ERhXM/fuKpmjEQ48PcY8f0TuDwc5J3+E3PagwLuZOHbAf+tkXMY4Dn+e62t0x6LCzfdI2WmUHp2fKOznwgysy1wBZAiUCf9Lfq/xYFHB+A0dTTrlW89lvGqwzExzTG7lg1Z7l0r0KDpbqW/zxyB7iDCGeLhHROkhYGbAnFOaUiGbQCdPFadliu8I+As7Z1QWhg00o0eYeGZyLxzgO/DwA6h74oI/LjUSj321elhQdcIMrOUhT0p9QjlO4a6M+qZwSLU5xA4D3B9oIABVVd2+nJaEzym+1k/7gHEXxV/CzgrlE5saHPgoqhZsiJrV54ZTdFXYstkuNdDD4u/NcTgsBSYdf5rMlqJrM49OsE7+wKyBdA50bCE3ABYTpruqtOFb0eI/y+FxzZExDOFI7NFvL4xouiLEJbDghG+U/ZSkGfGIGpMMpx6PADsDnwQeuTBI4xbawa1ZIuSHmtVVUBILB4OgepVN7DQaQagGddFlgZB+fNsEcvNKCEwrY2youulJDip98gzoyd+t7BqbjgJgHVUx6WVgsf/V8eXWpzdtHX2YKTLhVzvmC/tbEBJzKoyMe1P9rTtknVL6LoOq1JIL+9Z0Fw75PTJZmng5ICfhOWp37OeOQ6zWdegaaXMuHIA8828Zvju58RcWEzL+1wVZGDQvaes1fJQ5ZAZop4bwDrOdiPXLfeBTFt7SAKF0a5VN3s0Mi3au8YBVc5NmSQkrdux1wZRBdYBDghml87JM6Pzt6bI7vV7nR6pYTVIhB77xUG9C2pDnSDZqgq+FDAvRhtS9/Kf7L43cH9bp00GXAC8HMbudck8k2xifRX4LBNkI3sb8FUPSEqQYmHW2da79aJNkNDIOq1DP8b3dY5s0iOvnVJ9s15qbpF/Ow4WlmxDDL66xrdTj7xWSvM7s2M+4LJovK1lTQ/JOlgG3olKv8tteppxmmFt6HRGOiDPJP/OwR4pd26CP/uTTkhKkGIzrqLWA9/vbAXUy/OkzRrRKPbsKmM26ZFqpwGorLmCep8fZybDCvHCkvftamoroiYnWp1kyoZeqF4/So294i810ZcS5YW6h9Amp4mvPsoZHb06+GQMM8kxztOZQjn89YKk5FAzzKbbM8R7R2ZpIrN2nCes1BEVx1Z3xPSlE6I9IocnXy68lzqlkVn6PanfBkLzb3179C/VXI72rPFO7f0TggcLIFlksh0ywJ0a9VxNTvMjFTHyZDI59PlbMnyvxniBoP9Gca/pg/M6xz3/i7njLVlxtr/aJ2rFNKH5CjW1NbUcVQ26hlPWrPFfgyN/1JXESNlXD1mlfVxeKw0s2bPZ7AxUqDXQDaaSearwbJ9nWyCXqFwlTrNeSBRcHlo1h6yT089vQoy11SF0KWT1I89aMlshWVE3Ic8Zaq96VqqHfnC059A9DQP6cpofGwVOq4WykjQvVbZkny8BNqYntiQIJWd37rGmKEfiUNLHJVi2Fvczy/Qc+UOq4bW6l2RaOkDHSUO9zN0F+DwSo3V+I7RKSKTUHw7iwJozhGQRJc1MS1qCBMvp9aJr5FSgsw6zXTmj9O9w2jhN+dJwC6yzxTa0uED3ri1ChZML2WTXm9JIDqz5xvpjDbUeGZB1DC8P4vSiMNLhgKVHJqs9q5rtLrXbOm3AthrVx6UmWDQQUh1Elzi770sPndbehD6kbhaTfB94XQ4ALBuyvpJa2F5q9sXQaX2Zb/x8PHTa+LF7X1KHTuvLfOPn498AiO7PNNx85rYAAAAASUVORK5CYII=\" width=\"54.5\" height=\"18\" style=\"width: 54.5px; height: 18px;\"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = pp1()\r\n  y = [m,n,p];\r\nend","test_suite":"%%\r\ny = pp1();\r\nassert(all(y\u003e0));\r\nassert( isequal(y(1)^2+y(2)^2,13*y(3)) );\r\nyy1 = num2str(y(1));\r\nassert( all(yy1==fliplr(yy1)) )\r\nyy2 = num2str(y(2));\r\nassert( all(yy2==fliplr(yy2)) )\r\nyy3 = num2str(y(3));\r\nassert( all(yy3==fliplr(yy3)) )\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":2197980,"edited_by":2197980,"edited_at":"2022-04-20T06:54:09.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":"2022-04-20T06:54:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-04-14T03:21:34.000Z","updated_at":"2026-04-20T11:26:34.000Z","published_at":"2022-04-14T03:21:34.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eContinued Problem 50033: A palindrome \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is one-thirteenth of the sum of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e are also palindrome. Give an example of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(m,n,p)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. \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\"}]}"},{"id":44421,"title":"Portfolio diversification: choose your stocks !","description":"we have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example:\r\nstock1=[0.1 0.3 0.22 -.15 ] ;\r\nstock2=[0.3 0.4 -0.13 -0.22 ];\r\nstock3=[0.6 -0.3 0.44 0.05];\r\nSo portfolio ={'stock2' 'stock3'} because they are less correlated than any other combination.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 144.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 72.15px; transform-origin: 407px 72.15px; vertical-align: baseline; \"\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; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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; perspective-origin: 360px 8px; transform-origin: 360px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewe have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 116px 8.5px; tab-size: 4; transform-origin: 116px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estock1=[0.1 0.3 0.22 -.15 ] ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 120px 8.5px; tab-size: 4; transform-origin: 120px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estock2=[0.3 0.4 -0.13 -0.22 ];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 112px 8.5px; tab-size: 4; transform-origin: 112px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estock3=[0.6 -0.3 0.44 0.05];\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 291.5px 8px; transform-origin: 291.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSo portfolio ={'stock2' 'stock3'} because they are less correlated than any other combination.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function portfolio = your_fcn_name(stock1,stock2,stock3)\r\n  %portfolio = ?\r\nend","test_suite":"%%test 1\r\nstock1=[0.1 0.3 0.22 -.15 ] ;\r\nstock2=[0.3 0.4 -0.13 -0.22 ];\r\nstock3=[0.6 -0.3 0.44 0.05];\r\ny_correct ={'stock2' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 2\r\nstock1=[-0.1 0.4 -0.14 -.32 ];\r\nstock2=[0.35 -0.10 0.66 0.18 ];\r\nstock3=[0.62 -0.3 0.44 0.05];\r\ny_correct = {'stock1' 'stock2'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 3\r\nstock1=[0.3 0.4 -0.8 0.5 ];\r\nstock2=[0.62 0.2 -0.3 0.05];\r\nstock3=[0.35 -0.10 0.66 0.18 ];\r\ny_correct = {'stock1' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 4\r\nstock1=[-0.5 -0.2 0.35 0.02 ];\r\nstock2=[0.2 0.15 -0.3 0.13];\r\nstock3=[0.45 -0.04 0.66 0.2 ];\r\ny_correct = {'stock1' 'stock2'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 5\r\nstock1=[0.5 0.2 0.35 0.4 ];\r\nstock2=[-0.2 -0.15 -0.3 0.13];\r\nstock3=[-0.45 -0.04 0.33 0.15 ];\r\ny_correct = {'stock1' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 6\r\nstock1=[-0.32 -0.2 0.35 -0.4 ];\r\nstock2=[0.2 0.15 0.3 0.13];\r\nstock3=[-0.45 -0.04 -0.33 0.15 ];\r\ny_correct = {'stock2' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":156466,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2017-12-02T11:03:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-11-30T14:58:55.000Z","updated_at":"2026-03-23T18:16:52.000Z","published_at":"2017-11-30T14:58:55.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\u003ewe have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example:\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[stock1=[0.1 0.3 0.22 -.15 ] ;\\nstock2=[0.3 0.4 -0.13 -0.22 ];\\nstock3=[0.6 -0.3 0.44 0.05];]]\u003e\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\u003eSo portfolio ={'stock2' 'stock3'} because they are less correlated than any other combination.\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\"}]}"},{"id":58728,"title":"Add Odd and Subtract Even Numbers in an Array","description":"For an input array, add all the odd values and subtract the even values. The final value is the output.\r\nE.g.\r\ninput = [1 2 3 4 5]\r\noutput = 3","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor an input array, add all the odd values and subtract the even values. The final value is the output.\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eE.g.\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003einput = [1 2 3 4 5]\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eoutput = 3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = 3;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 2 4 5];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 2 4 5 6];\r\ny_correct = -6;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [2 4 5 7];\r\ny_correct = 6;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 2 4];\r\ny_correct = -5;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3469783,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-07-18T17:52:35.000Z","updated_at":"2026-04-07T08:41:52.000Z","published_at":"2023-07-18T17:52:35.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eFor an input array, add all the odd values and subtract the even values. The final value is the output.\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\u003eE.g.\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\u003einput = [1 2 3 4 5]\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\u003eoutput = 3\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\"}]}"},{"id":50292,"title":"Number Puzzle - 054","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGive an example of an integer y whose square has the form of 5_4_3_2_1 where \"_\" represents a single digit number.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = puzzle_054()\r\n  y = 54321;\r\nend","test_suite":"%%\r\ny=puzzle_054();\r\nassert(y==floor(y))\r\na=num2str(y^2,20);\r\nitest=[5 4 3 2 1];\r\nflag=true;\r\nfor i=1:5\r\n    if num2str(itest(i))~=a(2*i-1)\r\n        flag=false;\r\n    end\r\nend\r\nassert(flag)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":31,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-02-13T22:15:09.000Z","updated_at":"2026-04-17T15:43:57.000Z","published_at":"2021-02-13T22:15:09.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\u003eGive an example of an integer y whose square has the form of 5_4_3_2_1 where \\\"_\\\" represents a single digit number.\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\"}]}"},{"id":45882,"title":"Matrix indexing with two vectors of indices  (★★)","description":"(copy of Prob 589)\r\n\r\nGiven a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).\r\nThus, if\r\n\r\n  a = [ 1 2 5 ]\r\n  b = [ 4 5 2 ]\r\n  \r\n  M = [   17   24    1    8   15;\r\n          23    5    7   14   16;\r\n           4    6   13   20   22;\r\n          10   12   19   21    3;\r\n          11   18   25    2    9 ]\r\n\r\nthen \r\n\r\n  x = [ M(1,4) M(2,5) M(5,2) ]\r\n  x = [ 8 16 18 ]\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 337.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 168.667px; transform-origin: 407px 168.667px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 57.4583px 10.5px; transform-origin: 57.4583px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(copy of Prob 589)\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 314.7px 10.5px; transform-origin: 314.7px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 163.467px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 81.7333px; transform-origin: 404px 81.7333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 54.8167px 8.5px; transform-origin: 54.8167px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ea = [ 1 2 5 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 54.8167px 8.5px; transform-origin: 54.8167px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eb = [ 4 5 2 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eM = [   17   24    1    8   15;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        23    5    7   14   16;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e         4    6   13   20   22;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        10   12   19   21    3;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 134.933px 8.5px; transform-origin: 134.933px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        11   18   25    2    9 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 13.5833px 10.5px; transform-origin: 13.5833px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethen\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 20.4333px; transform-origin: 404px 20.4333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 118.067px 8.5px; transform-origin: 118.067px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ex = [ M(1,4) M(2,5) M(5,2) ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 63.25px 8.5px; transform-origin: 63.25px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ex = [ 8 16 18 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 84.4167px 10.5px; transform-origin: 84.4167px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAvoid using for/while loops.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function v = twoIndex(M,a,b)\r\n  v = M;\r\nend","test_suite":"%%\r\nM = rand(4);\r\na = [4 3 2 1];\r\nb = [1 2 3 4];\r\nv_correct = M([4 7 10 13]);\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nM = rand(4);\r\na = [3 3 1 3];\r\nb = [1 1 3 1];\r\nv_correct = M([3 3 9 3]);\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nM = rand(100);\r\n[a,b] = size(M);\r\nv_correct = M(end);\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nM = rand(100);\r\na = [];\r\nb = [];\r\nassert(isempty(twoIndex(M,a,b)))\t\r\n%%\r\nM = 1;\r\na = [1 1 1 1 1];\r\nb = [1 1 1 1 1];\r\nv_correct = [1 1 1 1 1];\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nfiletext = fileread('twoIndex.m');\r\nassert(isempty(strfind(filetext, 'for')),'for forbidden')\r\nassert(isempty(strfind(filetext, 'while')),'while forbidden')\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":428668,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":"2020-10-17T01:03:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-10T20:03:57.000Z","updated_at":"2026-04-26T22:44:08.000Z","published_at":"2020-06-10T20:03:57.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\u003e(copy of Prob 589)\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\u003eGiven a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if\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[a = [ 1 2 5 ]\\nb = [ 4 5 2 ]\\n\\nM = [   17   24    1    8   15;\\n        23    5    7   14   16;\\n         4    6   13   20   22;\\n        10   12   19   21    3;\\n        11   18   25    2    9 ]]]\u003e\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\u003ethen\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[x = [ M(1,4) M(2,5) M(5,2) ]\\nx = [ 8 16 18 ]]]\u003e\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\u003eAvoid using for/while loops.\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\"}]}"},{"id":42484,"title":"Repeat string n times - 2","description":"This is the two variable version of \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42482-repeat-string-n-times Repeat string n times\u003e.\r\n\r\n* you will have a string (s = 'str_')\r\n* a starting point (num1 = 4)\r\n* another starting point (num2 = 10)\r\n* a n (n = 4)\r\n\r\n output=\r\n  {'str_4_10'\r\n   'str_5_11'\r\n   'str_6_12'\r\n   'str_7_13'}","description_html":"\u003cp\u003eThis is the two variable version of \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42482-repeat-string-n-times\"\u003eRepeat string n times\u003c/a\u003e.\u003c/p\u003e\u003cul\u003e\u003cli\u003eyou will have a string (s = 'str_')\u003c/li\u003e\u003cli\u003ea starting point (num1 = 4)\u003c/li\u003e\u003cli\u003eanother starting point (num2 = 10)\u003c/li\u003e\u003cli\u003ea n (n = 4)\u003c/li\u003e\u003c/ul\u003e\u003cpre\u003e output=\r\n  {'str_4_10'\r\n   'str_5_11'\r\n   'str_6_12'\r\n   'str_7_13'}\u003c/pre\u003e","function_template":"function y = rep_str_2(str, num1, num2, n)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('rep_str_2.m');\r\nassert(isempty(strfind(filetext, 'for')))\r\nassert(isempty(strfind(filetext, 'while')))\r\n\r\n%%\r\nx = 'str_';\r\nnum1 = 4;\r\nnum2 = 10;\r\nn = 4;\r\ny_correct = {'str_4_10'\r\n'str_5_11'\r\n'str_6_12'\r\n'str_7_13'};\r\nassert(isequal(rep_str_2(x, num1, num2, n),y_correct))\r\n\r\n%%\r\nx = 'matstr_';\r\nnum1 = 0;\r\nnum2 = 50;\r\nn = 3;\r\ny_correct = {'matstr_0_50'\r\n'matstr_1_51'\r\n'matstr_2_52'};\r\nassert(isequal(rep_str_2(x, num1, num2, n),y_correct))\r\n\r\n%%\r\nx = 'matstr2_';\r\nnum1 = 2;\r\nnum2 = 3;\r\nn = 1;\r\ny_correct = {'matstr2_2_3'};\r\nassert(isequal(rep_str_2(x, num1, num2, n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2015-08-02T08:48:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-02T08:40:19.000Z","updated_at":"2026-05-01T11:32:45.000Z","published_at":"2015-08-02T08:48:37.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the two variable version of\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/problems/42482-repeat-string-n-times\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat string n times\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\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 will have a string (s = 'str_')\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\u003ea starting point (num1 = 4)\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\u003eanother starting point (num2 = 10)\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\u003ea n (n = 4)\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[ output=\\n  {'str_4_10'\\n   'str_5_11'\\n   'str_6_12'\\n   'str_7_13'}]]\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\"}]}"},{"id":42793,"title":"Fast 1-D Convolution (full shape)","description":"This is the first problem in the \u003chttp://www.mathworks.com/matlabcentral/cody/?term=Fast+1-D+Convolution fast 1-D convolution series\u003e. This problem asks you to find a fast algorithm to compute the 1-D convolution in its full output shape.  \r\n\r\nThere exists a fast 1-D convolution algorithm way more efficient than MATLAB's built-in *conv* function invoked in the form *conv(u,v,'full')*, and the performance improvement is more pronounced when length(u) and/or length(v) are large. Do you know how? Try it out. \r\n\r\n* Next problem: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42794-fast-1-d-convolution-same-shape Fast 1-D Convolution (same shape)\u003e.","description_html":"\u003cp\u003eThis is the first problem in the \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/?term=Fast+1-D+Convolution\"\u003efast 1-D convolution series\u003c/a\u003e. This problem asks you to find a fast algorithm to compute the 1-D convolution in its full output shape.\u003c/p\u003e\u003cp\u003eThere exists a fast 1-D convolution algorithm way more efficient than MATLAB's built-in \u003cb\u003econv\u003c/b\u003e function invoked in the form \u003cb\u003econv(u,v,'full')\u003c/b\u003e, and the performance improvement is more pronounced when length(u) and/or length(v) are large. Do you know how? Try it out.\u003c/p\u003e\u003cul\u003e\u003cli\u003eNext problem: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42794-fast-1-d-convolution-same-shape\"\u003eFast 1-D Convolution (same shape)\u003c/a\u003e.\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = fconv1f(u,v)\r\n  y = conv(u,v,'full');   % Extremely inefficient solution!\r\nend","test_suite":"%%\r\n%{\r\n╔═════════════════════════════════════════════════════════════╗\r\n║ Please note that problems in this series are designed for   ║\r\n║ optimizing the code performance, rather than the usual Cody ║\r\n║ \"size\". We are achieving this goal by courtesy of LY Cao's  ║ \r\n║ new scoring function, which automatically grants a better   ║\r\n║ score to a faster solution. Kindly note that simply using   ║\r\n║ the conv function may result in a poor score or even failure║\r\n║ in one of the tests. Suggestions and comments are welcome.  ║\r\n║                                                             ║\r\n║ Thanks \u0026 have fun!                                          ║\r\n║ Peng                                                        ║\r\n╚═════════════════════════════════════════════════════════════╝\r\n%}\r\n\r\n%%\r\nfid = fopen('EvaluateSolution.p','wb'); \r\nfwrite(fid,uint8(sscanf('7630312E30307630302E30300005B01CF7473FB1000000B50000010D000001A93014D309F9979F2A2C808C4F104ACA1480D0378FBCF4FF1C4C94A38C84A4969D0A597F5F12C8D564E7CD9584DF8BDD849A3B8C5FDEB66A3837A064275728B38736860BB79ABC4B3091D37C9A2010BE0378E708E59716738F85AA4AEBC8982C45E6CD45BAD19BD043D16D5834122D405752633CE6BD78ABA0676336E7BCDD4F2E181FF1CE8E9165F6BF30D850ED74385A40BDEB73AD82518B4CF2BB034951B1D23D360EDF335C22C209AAB3857BCEF61D192170FDE9D5449721A6B6DD082257E430059753696F1C5CD66E6B09AD24270B0335E830203EACA5BDF3E2A57620D5DB44A96AFCDE0387EF112F2A83FBF90E4AF09F9D4FCAA22134055610D0F7B55568D50A52CD5C46A3F0CA655C1B68','%2x')));\r\nfclose(fid);\r\n\r\n%%\r\nu = 1; v = 1;\r\ny_correct = 1;\r\nassert(isequal(fconv1f(u,v),y_correct))\r\n\r\n%%\r\nu = 1:10; v = 1:5;\r\ny_correct = [1,4,10,20,35,50,65,80,95,110,114,106,85,50];\r\nassert(all(abs(fconv1f(u,v)-y_correct)\u003c1e-10))\r\n\r\n%%\r\nu = [2 -4 0 1].'; v = [1:5].';\r\ny_correct = [2,0,-2,-3,-4,-17,4,5].';\r\nassert(all(abs(fconv1f(u,v)-y_correct)\u003c1e-10))\r\n\r\n%%\r\nu = rand(20,1); v = rand(10,1);\r\ny_correct = conv(u,v,'full');\r\nassert(all(abs(fconv1f(u,v)-y_correct)\u003c1e-10))\r\n\r\n%%\r\n% Large data size\r\nglobal sol_score\r\nu = rand(8e5,1); v = rand(1e5,1);\r\nt = builtin('tic');\r\ny = fconv1f(u,v);\r\nsol_score = 50*builtin('toc',t);\r\nAbsTol = 1e-6;   % Maximum absolute error tolerance\r\npass = EvaluateSolution(u,v,y,AbsTol);  \r\nassert(pass);\r\n\r\n%%\r\n% New scoring function by LY Cao\r\nglobal sol_score\r\nfid = fopen('score.p','wb');\r\nfwrite(fid,sscanf('7630312E30307630302E30300008501CD77E9FB100000035000001110000018422762999A8C1DE50537BEE443F4D73651F830FC6C78ADFB7DF68DF98823F565884DC58E21C7E397E3D26E4FFEA9A0D83589ABB5C0B0B553B44CFD79C9B272D11DF1965AD538598E8319529727DF4C4CF36A6016DD7816544AE5A8F64C9B2D9D0C4B94DD5EDF14595CBFE3D402647499EA3D9D125AC927454ED85973BCD1AAEA536D5A6CDDCD78A0211E8179603FFE12E4AB0E4704EA195704428700BAE5C4DFD42FF1A8760EDF2721F9724498ECC9F957735E7A3CDB9630DB17DF92ACE8F486706020E0A8D022D14BC313879724760AE20D67F572DD85211E4BEA45CDF3E22976253F113AEA96C1FF907329E4BD429BCFC6331077DA21F05D791DA6ECCF680D2E23AC77DFCE5C1D9869D3098F5B89FF92A','%2x'));\r\nfclose(fid);\r\nscore(sol_score);\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":"2016-04-04T03:53:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-04-02T21:05:59.000Z","updated_at":"2026-05-25T00:53:31.000Z","published_at":"2016-04-03T19:56:23.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the first problem in the\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/?term=Fast+1-D+Convolution\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efast 1-D convolution series\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This problem asks you to find a fast algorithm to compute the 1-D convolution in its full output shape.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere exists a fast 1-D convolution algorithm way more efficient than MATLAB's built-in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econv\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e function invoked in the form\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econv(u,v,'full')\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and the performance improvement is more pronounced when length(u) and/or length(v) are large. Do you know how? Try it out.\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\u003eNext problem:\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/problems/42794-fast-1-d-convolution-same-shape\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFast 1-D Convolution (same shape)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":1786,"title":"Create an index-powered vector","description":"Given a input vector x, return y as index-powered vector as shown below.\r\n\r\nExample\r\n\r\n x = [2 3 6 9]\r\n\r\nthen y should be \r\n\r\n [2^1 3^2 6^3 9^4] = [2 9 216 6561]\r\n","description_html":"\u003cp\u003eGiven a input vector x, return y as index-powered vector as shown below.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = [2 3 6 9]\u003c/pre\u003e\u003cp\u003ethen y should be\u003c/p\u003e\u003cpre\u003e [2^1 3^2 6^3 9^4] = [2 9 216 6561]\u003c/pre\u003e","function_template":"function y = index_power(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [2 3 6 9];\r\ny_correct = [2 9 216 6561];\r\nassert(isequal(index_power(x),y_correct))\r\n\r\n%%\r\nx = [1 5 11 0 -3 -6];\r\ny_correct = [1  25 1331 0 -243 46656];\r\nassert(isequal(index_power(x),y_correct))\r\n\r\n%%\r\nx = [0 8 -12 0 -8 -2];\r\ny_correct = [0 64 -1728 0 -32768 64];\r\nassert(isequal(index_power(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":1,"created_by":16381,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":955,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":13,"created_at":"2013-08-12T02:52:55.000Z","updated_at":"2026-05-18T16:12:57.000Z","published_at":"2013-08-12T02:54:18.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a input vector x, return y as index-powered vector as shown below.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\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[ x = [2 3 6 9]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen y should be\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[ [2^1 3^2 6^3 9^4] = [2 9 216 6561]]]\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\"}]}"},{"id":125,"title":"Remove DC","description":"Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.\r\n\r\nExample:\r\n\r\n Input  x = [  1  2  3  2  1  2  3]\r\n Output y = [ -1  0  1  0 -1  0  1]","description_html":"\u003cp\u003eInput x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e Input  x = [  1  2  3  2  1  2  3]\r\n Output y = [ -1  0  1  0 -1  0  1]\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [2 0];\r\ny_correct = [1 -1];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 0:100;\r\ny_correct = -50:50;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":451,"test_suite_updated_at":"2012-01-28T01:22:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-28T01:22:32.000Z","updated_at":"2026-04-27T22:55:08.000Z","published_at":"2012-02-03T02:39:08.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[ Input  x = [  1  2  3  2  1  2  3]\\n Output y = [ -1  0  1  0 -1  0  1]]]\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\"}]}"},{"id":49082,"title":"Energy Conversion 1","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 239px 8px; transform-origin: 239px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven an energy in the unit of BTU (British Thermal Unit), convert it to Joule.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = convert_stuff(x)\r\n  y = x+273.15;\r\nend","test_suite":"%%\r\nx = 123;\r\ny_correct = 129772.38;\r\nassert(abs(convert_stuff(x)-y_correct)\u003c1e-4)\r\n\r\n%%\r\nx = 0.015;\r\ny_correct = 15.8259;\r\nassert(abs(convert_stuff(x)-y_correct)\u003c1e-4)\r\n\r\n%%\r\nx = 66.3;\r\ny_correct = 69950.478;\r\nassert(abs(convert_stuff(x)-y_correct)\u003c1e-4)","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1062,"test_suite_updated_at":"2021-03-22T11:36:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T22:07:55.000Z","updated_at":"2026-05-21T15:28:17.000Z","published_at":"2020-12-22T22:07:55.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\u003eGiven an energy in the unit of BTU (British Thermal Unit), convert it to Joule.\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\"}]}"},{"id":120,"title":"radius of a spherical planet","description":"You just measured its surface area, that is the input.","description_html":"\u003cp\u003eYou just measured its surface area, that is the input.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 4*pi;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 400*pi;\r\ny_correct = 10;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 40000*pi;\r\ny_correct = 100;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = -4*pi;\r\ny_correct = 1i;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":19,"comments_count":9,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4500,"test_suite_updated_at":"2012-02-15T16:29:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-27T21:02:01.000Z","updated_at":"2026-05-27T06:55:42.000Z","published_at":"2012-02-15T16:45:42.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou just measured its surface area, that is the input.\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\"}]}"},{"id":47558,"title":"Guess the logic","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 141px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 70.5px; transform-origin: 343px 70.5px; vertical-align: baseline; \"\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGuess the logic and make a function logic(x) which will return y.\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(1) = 0\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(2) = 188\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(4) = 2256\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(6) = 8460\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = logic(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 0;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 188;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 4;\r\ny_correct = 2256;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 6;\r\ny_correct = 8460;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 10;\r\ny_correct = 42300;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 148050;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 20;\r\ny_correct = 357200;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 50;\r\ny_correct = 5757500;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 46530000;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 243;\r\ny_correct = 671623326;\r\nassert(isequal(logic(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":737003,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":24,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-11-19T10:01:39.000Z","updated_at":"2026-03-15T18:53:27.000Z","published_at":"2020-11-19T10:17:02.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\u003eGuess the logic and make a function logic(x) which will return y.\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\u003elogic(1) = 0\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\u003elogic(2) = 188\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\u003elogic(4) = 2256\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\u003elogic(6) = 8460\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\"}]}"},{"id":2012,"title":"Tony's trick for duplicating an mx1 vector n times","description":"Without using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n. v can be numeric or character. n may be 0.\r\n\r\nExamples\r\n\r\nIf\r\n\r\n v = 5;\r\n n = 3;\r\n\r\nthen return v1:\r\n\r\n v1 = [5 5 5] \r\n\r\nIf a 2d matrix is supplied then the vector v will be the first column.\r\n\r\n V = magic(4);\r\n n = 4;\r\n\r\nthen v and v1 are returned as shown below.\r\n\r\n v = [16 5 9 4]'\r\n v1 = [16 16 16 16; 5 5 5 5; 9 9 9 9; 4 4 4 4] \r\n\r\nHint: use indexing\r\n","description_html":"\u003cp\u003eWithout using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n. v can be numeric or character. n may be 0.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre\u003e v = 5;\r\n n = 3;\u003c/pre\u003e\u003cp\u003ethen return v1:\u003c/p\u003e\u003cpre\u003e v1 = [5 5 5] \u003c/pre\u003e\u003cp\u003eIf a 2d matrix is supplied then the vector v will be the first column.\u003c/p\u003e\u003cpre\u003e V = magic(4);\r\n n = 4;\u003c/pre\u003e\u003cp\u003ethen v and v1 are returned as shown below.\u003c/p\u003e\u003cpre\u003e v = [16 5 9 4]'\r\n v1 = [16 16 16 16; 5 5 5 5; 9 9 9 9; 4 4 4 4] \u003c/pre\u003e\u003cp\u003eHint: use indexing\u003c/p\u003e","function_template":"function v1 = reproduce_nv(v,n)\r\n  v1 = v;\r\nend","test_suite":"%%\r\nx=magic(3);\r\nn=3;\r\ny_correct=[8 8 8; 3 3 3; 4 4 4];\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n%%\r\nx=magic(10);\r\nn=19;\r\ny_correct=repmat(x(:,1),1,19);\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n%% \r\nx=1;\r\nn=0;\r\ny_correct=linspace(x,x,n); %arbitrary way to get the soln\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n%%\r\nx='1';\r\nn=7;\r\ny_correct=['1' '1' '1' '1' '1' '1' '1'];\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":17471,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-11-23T08:42:47.000Z","updated_at":"2026-04-02T12:30:19.000Z","published_at":"2013-11-23T08:48:28.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWithout using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n. v can be numeric or character. n may be 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\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[ v = 5;\\n n = 3;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen return v1:\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[ v1 = [5 5 5]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a 2d matrix is supplied then the vector v will be the first column.\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[ V = magic(4);\\n n = 4;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen v and v1 are returned as shown below.\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[ v = [16 5 9 4]'\\n v1 = [16 16 16 16; 5 5 5 5; 9 9 9 9; 4 4 4 4]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: use indexing\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\"}]}"},{"id":42438,"title":"row removal ","description":"Consider a matrix and remove the first row of the matrix.\r\n","description_html":"\u003cp\u003eConsider a matrix and remove the first row of the matrix.\u003c/p\u003e","function_template":"function y = remove_row(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx  = [ 1, 2, 3; 3, 5, 9; 1, 8, 0 ]\r\ny_correct  = [3, 5, 9; 1, 8, 0]\r\nassert(isequal(remove_row(x),y_correct))\r\n\r\n%%\r\nx  = [ 3, 5; 1, 0 ]\r\ny_correct  = [1, 0]\r\nassert(isequal(remove_row(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":43484,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":407,"test_suite_updated_at":"2015-07-14T21:03:19.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-06-29T06:48:13.000Z","updated_at":"2026-05-22T16:25:19.000Z","published_at":"2015-06-29T06:48:13.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider a matrix and remove the first row of the matrix.\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\"}]}"},{"id":640,"title":"Getting logical indexes","description":"This is a basic MATLAB operation.  It is for instructional purposes.\r\n\r\n---\r\n\r\nLogical indexing works like this.\r\n\r\n  thresh = 4;\r\n  vec    = [1 2 3 4 5 6 7 8];\r\n  \r\n  vi     = (vec \u003e thresh)\r\n  \r\n  vi =\r\n  \r\n       0     0     0     0     1     1     1     1\r\n\r\nOnce you have this TRUE FALSE vector (I call it vi: Valid Indices)\r\n\r\nIt can be used to get the values out:\r\n\r\n  big = vec(vi)\r\n  \r\n  big =\r\n  \r\n       5     6     7     8\r\n\r\nGiven a vector, vec, and a value, v, return a binary vector that represents the indices where vector, vec, is equal to scalar, v.\r\n\r\nNote, this works just as well with scalars and matrices.\r\n\r\n----\r\n\r\nTo get the indices where this comparison is true, see this \u003chttp://www.mathworks.com/matlabcentral/cody/problems/645-getting-the-indices-from-a-vector Cody problem\u003e.","description_html":"\u003cp\u003eThis is a basic MATLAB operation.  It is for instructional purposes.\u003c/p\u003e\u003cp\u003e---\u003c/p\u003e\u003cp\u003eLogical indexing works like this.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ethresh = 4;\r\nvec    = [1 2 3 4 5 6 7 8];\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003evi     = (vec \u003e thresh)\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003evi =\r\n\u003c/pre\u003e\u003cpre\u003e       0     0     0     0     1     1     1     1\u003c/pre\u003e\u003cp\u003eOnce you have this TRUE FALSE vector (I call it vi: Valid Indices)\u003c/p\u003e\u003cp\u003eIt can be used to get the values out:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ebig = vec(vi)\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ebig =\r\n\u003c/pre\u003e\u003cpre\u003e       5     6     7     8\u003c/pre\u003e\u003cp\u003eGiven a vector, vec, and a value, v, return a binary vector that represents the indices where vector, vec, is equal to scalar, v.\u003c/p\u003e\u003cp\u003eNote, this works just as well with scalars and matrices.\u003c/p\u003e\u003cp\u003e----\u003c/p\u003e\u003cp\u003eTo get the indices where this comparison is true, see this \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/645-getting-the-indices-from-a-vector\"\u003eCody problem\u003c/a\u003e.\u003c/p\u003e","function_template":"function vi = binaryEqualsVector(vec, v)\r\n  vi = true;\r\nend","test_suite":"%%\r\nvec = [1 2 3 3 2 1];\r\nv = 2;\r\ny_correct = [false true false false true false];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n\r\n%%\r\nvec = [1 2 3 4 5 6];\r\nv = 0;\r\ny_correct = [false false false false false false];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n\r\n%%\r\nvec = [1 1 1 1 1];\r\nv = 1;\r\ny_correct = [true true true true true];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n\r\n%%\r\nvec = 'abcdef';\r\nv = 'a';\r\ny_correct = [true false false false false false];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1188,"test_suite_updated_at":"2012-04-30T18:48:13.000Z","rescore_all_solutions":false,"group_id":12,"created_at":"2012-04-30T18:46:03.000Z","updated_at":"2026-05-02T11:20:39.000Z","published_at":"2012-04-30T18:48:13.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is a basic MATLAB operation. It is for instructional purposes.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e---\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLogical indexing works like this.\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[thresh = 4;\\nvec    = [1 2 3 4 5 6 7 8];\\n\\nvi     = (vec \u003e thresh)\\n\\nvi =\\n\\n       0     0     0     0     1     1     1     1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOnce you have this TRUE FALSE vector (I call it vi: Valid Indices)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIt can be used to get the values out:\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[big = vec(vi)\\n\\nbig =\\n\\n       5     6     7     8]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a vector, vec, and a value, v, return a binary vector that represents the indices where vector, vec, is equal to scalar, v.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote, this works just as well with scalars and matrices.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e----\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo get the indices where this comparison is true, see this\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/problems/645-getting-the-indices-from-a-vector\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody problem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":42917,"title":"Nth roots of unity","description":"First, find the n nth roots of unity.\r\neg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Root_of_unity\u003e\r\n\r\nSecond, raise each root to the power pi (.^pi).\r\n\r\nThird, sum the resulting numbers and use that as the output. \r\n","description_html":"\u003cp\u003eFirst, find the n nth roots of unity.\r\neg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Root_of_unity\"\u003ehttps://en.wikipedia.org/wiki/Root_of_unity\u003c/a\u003e\u003c/p\u003e\u003cp\u003eSecond, raise each root to the power pi (.^pi).\u003c/p\u003e\u003cp\u003eThird, sum the resulting numbers and use that as the output.\u003c/p\u003e","function_template":"function y = your_fcn_name(n)\r\n  y = 0;\r\nend","test_suite":"%%\r\nn = 5;\r\ny_correct =  -0.467800202134647;\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n\r\n%%\r\nn = 50;\r\ny_correct = -2.151544927902936 - 0.430301217000093i\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n\r\n%%\r\nn = 7;\r\ny_correct =   -0.435928596902380\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n\r\n\r\n%%\r\nn = 70;\r\ny_correct =   -3.031653804728051 - 0.430301217000095i\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":65480,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-01T00:25:42.000Z","updated_at":"2026-02-24T14:03:00.000Z","published_at":"2016-08-01T00:25:42.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFirst, find the n nth roots of unity. eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Root_of_unity\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Root_of_unity\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSecond, raise each root to the power pi (.^pi).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThird, sum the resulting numbers and use that as the output.\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\"}]}"},{"id":45177,"title":"Summing Rows and Columns","description":"Create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.\r\n\r\nFor example\r\n\r\n   x = [ 1  2  3\r\n         4  5  6\r\n         7  8  9 ]\r\n\r\nthen\r\n\r\n   y = [ 1  2  3  6 \r\n         4  5  6 15\r\n         7  8  9 24\r\n        12 15 18 45 ]\r\n","description_html":"\u003cp\u003eCreate a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.\u003c/p\u003e\u003cp\u003eFor example\u003c/p\u003e\u003cpre\u003e   x = [ 1  2  3\r\n         4  5  6\r\n         7  8  9 ]\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre\u003e   y = [ 1  2  3  6 \r\n         4  5  6 15\r\n         7  8  9 24\r\n        12 15 18 45 ]\u003c/pre\u003e","function_template":"function y = mat_man(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3;4 5 6;7 8 9];\r\ny_correct = [1 2 3 6; 4 5 6 15; 7 8 9 24; 12 15 18 45];\r\nassert(isequal(mat_man(x),y_correct))\r\n\r\n%%\r\nx=[1,2;3,4;5,6];\r\ny_correct =[1 2 3; 3 4 7;5 6 11;9 12 21];\r\nassert(isequal(mat_man(x),y_correct))\r\n     \r\n     \r\n     \r\n     ","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-10-17T17:04:42.000Z","updated_at":"2026-04-08T18:09:47.000Z","published_at":"2019-10-17T17:18:55.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example\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[   x = [ 1  2  3\\n         4  5  6\\n         7  8  9 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\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[   y = [ 1  2  3  6 \\n         4  5  6 15\\n         7  8  9 24\\n        12 15 18 45 ]]]\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\"}]}"},{"id":43564,"title":"Calculate sin(x) without sin(x)","description":"Calculate\r\ny = sin(x)\r\n\r\nx = 0 -\u003e y= 0\r\n\r\nwithout the use of sin(x) or cos(x)\r\n","description_html":"\u003cp\u003eCalculate\r\ny = sin(x)\u003c/p\u003e\u003cp\u003ex = 0 -\u0026gt; y= 0\u003c/p\u003e\u003cp\u003ewithout the use of sin(x) or cos(x)\u003c/p\u003e","function_template":"function y = my_func(x)\r\n  y = sin(x);\r\nend","test_suite":"x = 0;\r\ny_correct = 0;\r\nassert(abs(my_func(x)-y_correct)\u003c0.0001)\r\n\r\n%%\r\nx = -pi/2;\r\ny_correct = sin(x);\r\nassert(abs(my_func(x)-y_correct)\u003c0.0001)\r\n\r\n%%\r\nx = rand(1)*2*pi;\r\ny_correct = sin(x);\r\nassert(abs(my_func(x)-y_correct)\u003c0.0001)\r\n\r\n%%\r\nassessFunctionAbsence({'cos', 'sin'}, 'FileName', 'my_func.m');\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":14644,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":119,"test_suite_updated_at":"2016-12-01T18:41:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-16T10:50:54.000Z","updated_at":"2026-04-24T08:33:53.000Z","published_at":"2016-10-16T10:50:54.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate y = sin(x)\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\u003ex = 0 -\u0026gt; y= 0\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\u003ewithout the use of sin(x) or cos(x)\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\"}]}"},{"id":2362,"title":"What day is it?","description":"Tell me what day is it. Return the full name of the day of the week as a string.\r\n\r\ne.g. It's June 12th 2014, so your function should return 'Thursday'","description_html":"\u003cp\u003eTell me what day is it. Return the full name of the day of the week as a string.\u003c/p\u003e\u003cp\u003ee.g. It's June 12th 2014, so your function should return 'Thursday'\u003c/p\u003e","function_template":"function y = day_of_week()\r\ny = 'Friday';\r\nend","test_suite":"%%\r\ntoday = java.util.Date;\r\nc = java.util.Calendar.getInstance();\r\nc.setTime( today );\r\ndayOfWeek = c.get(java.util.Calendar.DAY_OF_WEEK);\r\nswitch dayOfWeek\r\n    case 1\r\n        dayOfWeek = 'Sunday';    \r\n    case 2\r\n        dayOfWeek = 'Monday';\r\n    case 3\r\n        dayOfWeek = 'Tuesday';\r\n    case 4\r\n        dayOfWeek = 'Wednesday';\r\n    case 5\r\n        dayOfWeek = 'Thursday';\r\n    case 6\r\n        dayOfWeek = 'Friday';\r\n    case 7\r\n        dayOfWeek = 'Saturday';\r\nend\r\nassert(strcmp(dayOfWeek,day_of_week()))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":450,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":222,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-12T20:06:06.000Z","updated_at":"2026-03-12T20:06:11.000Z","published_at":"2014-06-13T14:20:59.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTell me what day is it. Return the full name of the day of the week as a string.\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\u003ee.g. It's June 12th 2014, so your function should return 'Thursday'\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\"}]}"},{"id":2051,"title":"is the number happy?","description":"test is a given integer number is Happy of not?\r\nanswer 1 if yes or 0 is no","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 146.5px 8px; transform-origin: 146.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003etest is a given integer number is Happy of not?\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 78.5px 8px; transform-origin: 78.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eanswer 1 if yes or 0 is no\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function tf = ishappy(n)\r\n  tf='?';\r\nend","test_suite":"%%\r\nn = 10;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),n))\r\n%%\r\nn = 2;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),rem(n,2)))\r\n%%\r\nn = 31;\r\nassert(isequal(ishappy(n),rem(n,2)))\r\n%%\r\nn = 13;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 11;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 47;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 101;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 100;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 130;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 230;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 190;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 290;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 998;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":17471,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":77,"test_suite_updated_at":"2022-02-07T06:56:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-12-15T04:37:05.000Z","updated_at":"2026-01-09T18:26:15.000Z","published_at":"2013-12-15T05:19:36.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\u003etest is a given integer number is Happy of not?\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\u003eanswer 1 if yes or 0 is no\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\"}]}"},{"id":2120,"title":"Rounding off numbers to n decimals","description":"Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point number to n decimals. There are 2 inputs to the function: x: floating point number and n: number of decimals which need to match with the given solutions.","description_html":"\u003cp\u003eInspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point number to n decimals. There are 2 inputs to the function: x: floating point number and n: number of decimals which need to match with the given solutions.\u003c/p\u003e","function_template":"function y = myround(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nn=1;\r\ny_correct = 1;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = pi;\r\nn=5;\r\ny_correct = 3.14159;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = 0.5*sqrt(2);\r\nn=6;\r\ny_correct = 0.707107;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = exp(1);\r\nn=9;\r\ny_correct = 2.718281828;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = 0.00123456;\r\nn=6;\r\ny_correct = 0.001235;\r\nassert(isequal(myround(x,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":24,"comments_count":3,"created_by":20079,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5730,"test_suite_updated_at":"2014-01-15T04:17:27.000Z","rescore_all_solutions":false,"group_id":38,"created_at":"2014-01-15T04:03:48.000Z","updated_at":"2026-05-27T12:21:47.000Z","published_at":"2014-01-15T04:14:20.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point number to n decimals. There are 2 inputs to the function: x: floating point number and n: number of decimals which need to match with the given solutions.\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\"}]}"},{"id":1985,"title":"How unique?","description":"Sometimes, when we check unique entries of vector we would like to know how many times each value occurs.\r\n\r\nGiven vector of numbers *A* return vector *U* of unique values of A and corresponding vector *H* with occurrences.\r\n\r\nExample:\r\n\r\n   in:  A = [2 2 2 3 3 2 3 8 6 5 6]\r\n  out:  U = [2 3 8 6 5]\r\n        H = [4 3 1 2 1]  ","description_html":"\u003cp\u003eSometimes, when we check unique entries of vector we would like to know how many times each value occurs.\u003c/p\u003e\u003cp\u003eGiven vector of numbers \u003cb\u003eA\u003c/b\u003e return vector \u003cb\u003eU\u003c/b\u003e of unique values of A and corresponding vector \u003cb\u003eH\u003c/b\u003e with occurrences.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e   in:  A = [2 2 2 3 3 2 3 8 6 5 6]\r\n  out:  U = [2 3 8 6 5]\r\n        H = [4 3 1 2 1]  \u003c/pre\u003e","function_template":"function [U,H] = hunique(A)\r\n  U = 1:5;\r\n  H = ones(1,5);\r\nend","test_suite":"%%\r\nA = [2 2 2 3 3 2 3 8 6 5 6];\r\n[U, H] = hunique(A);\r\nU_ok = [2 3 8 6 5];\r\nH_ok = [4 3 1 2 1];\r\nassert(isequal(U,U_ok));\r\nassert(isequal(H,H_ok));\r\n%%\r\nA = [2 2 2 3 3 2 3 8 6 5 6 8];\r\n[U, H] = hunique(A);\r\nU_ok = [2 3 8 6 5];\r\nH_ok = [4 3 2 2 1];\r\nassert(isequal(U,U_ok));\r\nassert(isequal(H,H_ok));\r\n%%\r\nA = 100:-11:1;\r\nassert(isequal(hunique(A),A));\r\n[~,H] = hunique(A);\r\nassert(isequal(H,ones(1,10)));\r\n%%\r\nA = randi([-10 10],1,100);\r\n[U,H] = hunique(A);\r\nassert(sum(H)==numel(A));\r\nassert(isequal(unique(A),sort(U)));\r\n\r\n% number of test cases may increace in the future.\r\n% any proposals of test cases warmly welcome.","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":140,"test_suite_updated_at":"2014-04-06T18:52:22.000Z","rescore_all_solutions":false,"group_id":21,"created_at":"2013-11-12T23:00:10.000Z","updated_at":"2026-05-05T20:00:31.000Z","published_at":"2013-11-13T23:40:01.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSometimes, when we check unique entries of vector we would like to know how many times each value occurs.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven vector of numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e return vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eU\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of unique values of A and corresponding vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eH\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with occurrences.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[   in:  A = [2 2 2 3 3 2 3 8 6 5 6]\\n  out:  U = [2 3 8 6 5]\\n        H = [4 3 1 2 1]]]\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\"}]}"},{"id":45446,"title":"Create logarithmically spaced values (★)","description":"Given three numbers a,b,n with b\u003ea, create a vector y with n logarithmic spaced values between 10^a and 10^b.\r\nThus, if a = -2, b = 3 and n = 6, then \r\n\r\n  y = [10^-2 10^-1 10^0 10^1 10^2 10^3] = [0.01 0.1 1.0 10.0 100.0 1000.0]  ","description_html":"\u003cp\u003eGiven three numbers a,b,n with b\u0026gt;a, create a vector y with n logarithmic spaced values between 10^a and 10^b.\r\nThus, if a = -2, b = 3 and n = 6, then\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey = [10^-2 10^-1 10^0 10^1 10^2 10^3] = [0.01 0.1 1.0 10.0 100.0 1000.0]  \r\n\u003c/pre\u003e","function_template":"function y = logarithmic_spacing(a,b,n)\r\n  y = 1;\r\nend","test_suite":"%%\r\na = -2; b = 3; n = 6;\r\ny_correct = [0.01 0.1 1.0 10.0 100.0 1000.0];\r\nassert(isequal(y_correct,logarithmic_spacing(a,b,n)))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":428668,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":117,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-12T21:20:54.000Z","updated_at":"2026-02-18T16:39:46.000Z","published_at":"2020-04-12T21:20:54.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven three numbers a,b,n with b\u0026gt;a, create a vector y with n logarithmic spaced values between 10^a and 10^b. Thus, if a = -2, b = 3 and n = 6, then\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[y = [10^-2 10^-1 10^0 10^1 10^2 10^3] = [0.01 0.1 1.0 10.0 100.0 1000.0]]]\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\"}]}"},{"id":44078,"title":"GJam 2017 Kickstart: Leader (Small) ","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/6304486/dashboard#s=p0 GJam 2017 Kickstart Leader\u003e. This is the first 61 small cases with no spaces in names.\r\n\r\n\u003chttp://code.google.com/codejam Google Code Jam 2017 Qualifier\u003e is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.\r\n\r\nThe GJam story is to determine the rightful leader.  The leader is the person whose name utilizes the most unique letters, spaces do not count, and if two or more people are tied then the leader is the one whom comes first alphabetically, with space preceding A, given a list of 100 or fewer names.\r\n\r\n*Input:* [names], a cell array of names using only A thru Z; max 100 names\r\n\r\n*Output:* [Leader], a string of the name of the leader\r\n\r\n*Examples:* [names] [Leader]; {'ADAM' 'BOB' JOHNSON'} ['JOHNSON']\r\n\r\nFor the example the first two have three and two unique letters while JOHNSON has five unique letters 'JOHNS'.\r\n\r\n*Theory:* Brute force processing appears to be the way.  Methodical processing and function usage can minimize code size. \u003chttp://code.google.com/codejam/contest/6304486/scoreboard#vf=1 GJam Kickstart solutions(C++,Python)\u003e. ","description_html":"\u003cp\u003eThis Challenge is derived from \u003ca href = \"http://code.google.com/codejam/contest/6304486/dashboard#s=p0\"\u003eGJam 2017 Kickstart Leader\u003c/a\u003e. This is the first 61 small cases with no spaces in names.\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://code.google.com/codejam\"\u003eGoogle Code Jam 2017 Qualifier\u003c/a\u003e is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.\u003c/p\u003e\u003cp\u003eThe GJam story is to determine the rightful leader.  The leader is the person whose name utilizes the most unique letters, spaces do not count, and if two or more people are tied then the leader is the one whom comes first alphabetically, with space preceding A, given a list of 100 or fewer names.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [names], a cell array of names using only A thru Z; max 100 names\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e [Leader], a string of the name of the leader\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e [names] [Leader]; {'ADAM' 'BOB' JOHNSON'} ['JOHNSON']\u003c/p\u003e\u003cp\u003eFor the example the first two have three and two unique letters while JOHNSON has five unique letters 'JOHNS'.\u003c/p\u003e\u003cp\u003e\u003cb\u003eTheory:\u003c/b\u003e Brute force processing appears to be the way.  Methodical processing and function usage can minimize code size. \u003ca href = \"http://code.google.com/codejam/contest/6304486/scoreboard#vf=1\"\u003eGJam Kickstart solutions(C++,Python)\u003c/a\u003e.\u003c/p\u003e","function_template":"function Leader=leader(names)\r\n% cell array of names 1xk\r\n% A:Z or Space in the large case. Note space precedes A alphabetically\r\n% Leader is name with most unique letters A:Z. Tie goes to first name alphabetic.\r\n%\r\nLeader=''; % string\r\n \r\nend","test_suite":"%%\r\nnamec={'ITWUORWMTIHLHXND','YWJRRIJNZBSVKLGZSTOS','ELAUQVVEKJMTWANC','EYHASDSIJOFKAJMOBES','FWWT','NCXHB','HL','RLFYACE','AGEOICCFQQQ','OA','HIIE','TCKTEPLEVQKUQEOWV','A','OARWWOWVOTHDV','PRZOIMYUVVENMEFTGND','TRTDGSTGO','XCNBHNURLC','QUDOEEPPPTOEK','CYCS','HLZHZXMWF','VTILQQXFLTHGW','JCLINHPIAFNTTJ','XXFYEVKXHHEODKH','MSMRUKZJGLXXAMZ','TCUPQXPTAECNWPX','YWPPGXGWQS','CMWGICOTZKVNXFJGPB','MJ','PEGZVIQZWWY','RAM','CDZ','BYHBVFDD','HJBUJRQ','BCYSCGACSNDEK','FAX','V','GDHUQRC','AEFTELYHXD','ZAJLLAHJTD','JTZINGJ','MUPIXBGXISKYTLFWEF','XI','DTFDCLELPYSXSTDTNPCL','QPR','IRTDYHWLDN','VGQCLWS','VZTYIFJRPKFENZU','S','CVWAFVIHLTVFFZYZAJ','HTJ','CFPPXYRGRJDAJD','YKZUWMAFLLOO','LUEP','DCIGCJBFQZ','FPITIZAL','GRNHJMHMHHLBRMHQAPDS','K','STNVAPRYZHYMGXPHKOT','V','AMZSA','HGQANFRDWECVUOO','QTDJYMJGHTXFBKHGNDPM','WJHN','QCANDRZEPCYONLCVIR','MEAR','MMUPHNMPQGELDXNQUNN','RZGVCAHMKZ','J','CYQAQULTG','SKRIQOSQJTFQXHLFR','DVTSYAQKECAW','IJQQSONVKAKKE','BPTSIFKWCZCFLOYZCHI','KJDUFENMXBMW','AGBYXTTYADT','SZUYKXYN','KDJNEQOUJDJVBYJSOG','SYKSOIBCKFDXBLH','NLBEBYUKFEDB','VIHKWHLQSIMLJXLBWY','XSPZPLYSMMQEU','OEPRNDZGFSRJBWLY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CMWGICOTZKVNXFJGPB'))\r\n%%\r\nnamec={'ZHWIEVQY','J','TLCILYLZBIY','FQDRXDBMLD','V','VDZCFZFVWOHRYEZ','EXIVJDONPLRYBSSMDNJY','BJUKZQGUNODOS','ZOWWHCMZ','PBPBN','CZTMQECVKFPDPOJRBKE','RFWTTBVG','LSU','NMRDJISMPYOPPBQRQF','AQOX','MFKXSJGWTB','TG','GMTVFGICOFOVL','NYFPRPZPHOQBDPDLFYQ','ZKJAIXOTXFMOGH','ONHHQFYAJR','YMDESSRM','ODUJTUPZ','OLRMFRNEWMI','PNJ','XSABDDN','EYGMT','SBNXXZNHZPDDSHDLC','YYLCARXECOAJRNIPAPK','SNKLYGHSEAJNXOPHDIIU','JGQHZFGVSQTWMF','M','QMZABHEHZNGWTXWO','A','IWSNMWEPVCQUVVSID','WWKOAMZASDPIVGSS','BMAWDVMNVPIOH','KDWDNRSMZHX','GHTSILNVPNATHRSKMKN','TXAGASW','YAEDJNTGS','ZHDYQVEVYJRN','JUZEFWDFTZJAS','VR','QZMQUWZZQFHLDLR','HOCXYNXM','HVLPIHZTLMPRWBME','W','ZU','KRQDDXKQEZYMWLXE','IYDXZ','GAAXUDATDVMNJAXVOGK','PEQIWYUYTNHQIH','UKRYPQDPBQXKLIG','IOSBQBICCHW','PQYBUJCGAXVCEVJYBS','YELCNJFSD','MENCFWQISHJFIGR','AOAYMFZBD','ERJBNWAHTOXCXHWF','RP','VUHINKNRTWKYGKXYJPTC','SQNYR','VDC','PJNLTP','LQSBGPKVEOUKI','ZWDTTSUCQ','NX','ZLBFCC','RFYNJWTWYWTMZI','FUZNVJGKXEYN','MS','EHO','GKJXLCUBUZPV','NRFCAVUNMCBEHIL','JAHZDCPWLMN','RWXOYX','GRIOHZEUXHMNSQSP','KASXYCVDKMRKLMH','JU','NTHZYRMMYIW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SNKLYGHSEAJNXOPHDIIU'))%%\r\nnamec={'ITWUORWMTIHLHXND','YWJRRIJNZBSVKLGZSTOS','ELAUQVVEKJMTWANC','EYHASDSIJOFKAJMOBES','FWWT','NCXHB','HL','RLFYACE','AGEOICCFQQQ','OA','HIIE','TCKTEPLEVQKUQEOWV','A','OARWWOWVOTHDV','PRZOIMYUVVENMEFTGND','TRTDGSTGO','XCNBHNURLC','QUDOEEPPPTOEK','CYCS','HLZHZXMWF','VTILQQXFLTHGW','JCLINHPIAFNTTJ','XXFYEVKXHHEODKH','MSMRUKZJGLXXAMZ','TCUPQXPTAECNWPX','YWPPGXGWQS','CMWGICOTZKVNXFJGPB','MJ','PEGZVIQZWWY','RAM','CDZ','BYHBVFDD','HJBUJRQ','BCYSCGACSNDEK','FAX','V','GDHUQRC','AEFTELYHXD','ZAJLLAHJTD','JTZINGJ','MUPIXBGXISKYTLFWEF','XI','DTFDCLELPYSXSTDTNPCL','QPR','IRTDYHWLDN','VGQCLWS','VZTYIFJRPKFENZU','S','CVWAFVIHLTVFFZYZAJ','HTJ','CFPPXYRGRJDAJD','YKZUWMAFLLOO','LUEP','DCIGCJBFQZ','FPITIZAL','GRNHJMHMHHLBRMHQAPDS','K','STNVAPRYZHYMGXPHKOT','V','AMZSA','HGQANFRDWECVUOO','QTDJYMJGHTXFBKHGNDPM','WJHN','QCANDRZEPCYONLCVIR','MEAR','MMUPHNMPQGELDXNQUNN','RZGVCAHMKZ','J','CYQAQULTG','SKRIQOSQJTFQXHLFR','DVTSYAQKECAW','IJQQSONVKAKKE','BPTSIFKWCZCFLOYZCHI','KJDUFENMXBMW','AGBYXTTYADT','SZUYKXYN','KDJNEQOUJDJVBYJSOG','SYKSOIBCKFDXBLH','NLBEBYUKFEDB','VIHKWHLQSIMLJXLBWY','XSPZPLYSMMQEU','OEPRNDZGFSRJBWLY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CMWGICOTZKVNXFJGPB'))\r\n%%\r\nnamec={'ZHWIEVQY','J','TLCILYLZBIY','FQDRXDBMLD','V','VDZCFZFVWOHRYEZ','EXIVJDONPLRYBSSMDNJY','BJUKZQGUNODOS','ZOWWHCMZ','PBPBN','CZTMQECVKFPDPOJRBKE','RFWTTBVG','LSU','NMRDJISMPYOPPBQRQF','AQOX','MFKXSJGWTB','TG','GMTVFGICOFOVL','NYFPRPZPHOQBDPDLFYQ','ZKJAIXOTXFMOGH','ONHHQFYAJR','YMDESSRM','ODUJTUPZ','OLRMFRNEWMI','PNJ','XSABDDN','EYGMT','SBNXXZNHZPDDSHDLC','YYLCARXECOAJRNIPAPK','SNKLYGHSEAJNXOPHDIIU','JGQHZFGVSQTWMF','M','QMZABHEHZNGWTXWO','A','IWSNMWEPVCQUVVSID','WWKOAMZASDPIVGSS','BMAWDVMNVPIOH','KDWDNRSMZHX','GHTSILNVPNATHRSKMKN','TXAGASW','YAEDJNTGS','ZHDYQVEVYJRN','JUZEFWDFTZJAS','VR','QZMQUWZZQFHLDLR','HOCXYNXM','HVLPIHZTLMPRWBME','W','ZU','KRQDDXKQEZYMWLXE','IYDXZ','GAAXUDATDVMNJAXVOGK','PEQIWYUYTNHQIH','UKRYPQDPBQXKLIG','IOSBQBICCHW','PQYBUJCGAXVCEVJYBS','YELCNJFSD','MENCFWQISHJFIGR','AOAYMFZBD','ERJBNWAHTOXCXHWF','RP','VUHINKNRTWKYGKXYJPTC','SQNYR','VDC','PJNLTP','LQSBGPKVEOUKI','ZWDTTSUCQ','NX','ZLBFCC','RFYNJWTWYWTMZI','FUZNVJGKXEYN','MS','EHO','GKJXLCUBUZPV','NRFCAVUNMCBEHIL','JAHZDCPWLMN','RWXOYX','GRIOHZEUXHMNSQSP','KASXYCVDKMRKLMH','JU','NTHZYRMMYIW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SNKLYGHSEAJNXOPHDIIU'))\r\n%%\r\nnamec={'LKVZZUM','IGFIF','LDWQNWLKKUZRSLNQPZUD','REYHMPLN','RCYUXMNRNM','KIXERSLPASSPBSZ','MOIJUM','CKLGNTVKPJUQVHFKOJYC','CLWO','F','HQBUXWNYFCKBHP','SZOUKQXZW','VTSUFMCZRBVWZXSX','LVSGFAJNPEAZQLQNXSJ','FKD','SHXDHEYZDVZMEKQXDL','OTXAYLGZXQYQUCUOTPHC','NSMRSGMRYNJNHRDBIJNP','UNCSUEFJWEOCCEAUVD','CLSFESORDOQ','VZCJFLXKE','BXRX','ULAQVGZMZDUQAKDZ','F','PQIRUOKFBEANPWHR','DNTYVUERHOWWWAX','NHMSAQTFXLWC','QGGAKSERLLBZMYS','XANXQC','CGRYIBLGJGITDGJXVQL','JMWZUQP','WCJ','DMXNGYCBWWBVWP','DXJHPUCLEYGNRJZJDIPC','LQHEATYFA','UOOAKBGYKHLTCMV','ECXDXYK','TPPFDLEZVFBHIBL','DXQZVMTOQSKGVGVEQH','MVGNOGJEKYUQCQWKONSU','YDXTWABNGHMVNNR','IHMQBV','EKORVOGNTFM','MTQZZAECALPQE','IIAXZLJMLPSWOXIFODF','FVMFSCOCO','KXF','APFP','CEUKJEFHPCE','HKQJYNMPT','ZEBJEIG','BAHVCJRQCCMX','WJKIOOPDLL','EMENSPOLPNYONCJPOC','LSLPVWSVSAZBKCHVR','FDTSF','ZUWDLZVKNYR','IFSFFUQJYEMFOSZBAJ','LFSNKMBHVGRSEWI','WGLBXIFWXQQPZ','AAC','NDKE','WFMWRVTOHZEVSUHQMWIM','LRTOVVMFQONLNCZ','DIUDEPSGTFKHY','PMOQT','BWONTNIT','LXXSEW','JCPZSFLQB','WJLMGE','URPRN','MJ','NJRHYNZWYDXJZDMBI','OZDCEA','ZMOGQE','VVPPYAQMZULHLP','NUC','H','FEFYDOVFMLNLLHM','KNPEI','YPYVMVIPFDDDOQCRHN','TUMWDLK','PSCZOXGBOLWRGXWLWETD','CZTFF','NPPDNACLYJX','SVMMODP','EBPEYFJCQFBIHNCILTP','ZSQXRMZYDOAICOQHPYHU','HKIEWXFRENDNUIHZVJ','UQIJF','XV','DRMGAISIOH','CCRXDBOU','DTAUYOKXRFPGD','FJFZDAMDODXIGERXXIC','NRPLMN'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CKLGNTVKPJUQVHFKOJYC'))\r\n%%\r\nnamec={'RZBUJBVYEBGFA','UQQZUUEPNZQGWI','MEVRXOPONULOFXCNJC','OX','AI','KQDWMQ','GB','UGUXMZRPA','JLPXQPEYBGKUPNOVO','DUNZANKBCLMRE','ZUTGVIJRXWBG','YBLGDIAFTFWXGJFSIDJ','MKPDQB','EXZ','XSPHULXTUUH','YI','SDRNMNHGLLAGWPCAQCN','ZCJHBAXB','VTWJZEWCDZ','DCSV','K','CXTRGSSG','TZDBKEGTJODEI','OA','ZZ','SGGYYQWGS','UGRZHKKCKLRCM','CWU','GAHGFI','EHNRYUPAJHEJQALIXXN','VNUUMZUMVTLGQF','JOJ','DTVZWKINQSLWYC','HNIELOMQRNWSRSFOJP','WBN','AZZQ','WPCBLNHQVQ','FFPEGUSPFC','QZVDUHWFOYF','MODJT','YPTOMLGWCBEB','JPBDAHELDOWYAHOH','LTYAWWOYYKRJUY','LD','ATWGLRGLX','GYAQPCCBMTKYON','EJGXJQH','ZNCSTJONBCWQEYJIOUDU','BQHJZZ','RMKTA','UO','WISAENKNTWQJJJR','QDEOAVK','B','DP','QPIVRVKJLTARRYU','AUEWOQXHLNOH','AQURWTVDAV','RI','VKUZECHUBKDQSYIEGR','GQXG','QPIZPWFRE','LLVFWQVKKVGQ','BOHSFPVLG','QDGNJQKOA','KHSIXTK','X','HOMSMBH','JASGHSCEVJPZEBRWIPHP','MZF','EEX','LDWAANCPMTO','DFOSFACRRWBZSZRGP','UPKDRRIGWMB','TLYLODNZAI','RRMHCO','RQXDXZBHA','TNN','RCEUCCHTGPV'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'VKUZECHUBKDQSYIEGR'))\r\n%%\r\nnamec={'RIVNPYCJWCV','OGILAGJP','SEMHSESRIMDCHE','JRYPYYQBGCQDMUVYTK','PUOCTXXCFLSVMSNN','HMTLDFW','MHRCIQBMPZJSNWPR','B','WBRPSYSLQUTYTMIOMAAD','X','SHHZDMOTCYXKOEF','JDWI','GVGN','SF','FMZXHACXMMHQJCZFYEA','RVWR','UOHRSYKYJPSYXBFCBUAN','EGGFS','MFB','IXJEMEXV','VOSNTCBQAHVSMQ','ZYCS','GWLD','TQHICAYCAHNMD','ZUPTJKZXKY','NALYIAYH','YUVBDDYUR','JSUEAMBVXC','BCGACYPVUKQJF','SOAEDJRTMC','GIM','DDKQJMZKRYYQUUNXJPLS','WAGEH','ACDMUQHJX','UJUCPFLWIWA','ZNCENEADIUCYTDU','CVQ','OIUWAJ','PELUGQEKQHSBEJ','ZVWEBCDPDPZYWKUEB','MUIKNTXIKIGJWJYZR','UDIX','EQUINTBTACTNCVV','A','QRQCTCOFGAGFH','GVPKX','XXZYHYCQCQOWTXHCU','ZYXQBZB','TRZFYLHLGE','MYLXVXPROOQACCREXGNK','HW','K','O','YJDRWVCHIYNO','OGFIXBXOECV','MYIPYKDMC','LKAZRCB','HBQIYHWJGQVAQK','KAOEMQAEDRGCOSWN','PEVMKNMBNQHJOLZPPU','WQGFHUTZXNKXXSO','DATMPBAWIUI','HFMNTXAIINT','EYSGATS','ELMSTZUCYKGVW','AWELUDPHWE','WXXT','BYZGU','QTKIDJAZOLQJ','XCWQPWF','SHZMZNSIYTFWGJMIR','CQTBY','PAXDKIQ','QKPFHU','FRVKRIYOLC','EVLSGGJROSCDEESC','BNBKELFFEIHEZU','GTVPGG','ABAF','CAMHBXEMVJ','RJIQNECRLR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MYLXVXPROOQACCREXGNK'))\r\n%%\r\nnamec={'IPRJSIWLAUJOORGCCTGB','QNJUCJUG','UESLBPMHAOXY','MAEFTMSUCVADS','HSBZYCEBXHQUMMQEBUX','WG','NBCL','JAVVHRIWN','BZUAGAL','KJPLV','BWLWTYKMYR','ZFREZGVRDXAJAOUBBP','ZGTFGRNBOC','SRHLEKFXDGXR','QHTBROH','OFMXKGHMRZKZWWFTQ','ZBRNSZCLM','LSWQXPSVOWACZJSCLPU','I','WTAWIPAXWSOHLOJG','GHUAFRDMHYCPJ','QLXLWQWPDMQBOOI','OFFSREM','LN','IENTDWRP','PWJTIKZWKWGHQQC','N','YNAAY','RVOXH','DGFWIGPZN','TZVZQIAQZHERN','QLAFRTPG','DVMQPCEHDPZXONAS','NIJY','G','ZKEMNSRWZTYIVJ','JYMWYWPARPXPKVDUSH','YSPFGKNLLGXNWHUOI','VXPCGSWYZS','UAZEC','YNMOLESKERXT','ZMKMIUTTHPVIJ','MQAJNGBCLVWFRKSWS','TIAPONYPCBCIPGISAL','ORYFPRXZXX','IE','PGXIAXPUVYIVFSO','WTOJEJA','YVGYRWBQ','JQARHV','PFIZDXYZEIJJ','GDKETMNEOWBKEGPEYSSG','ZDOBW','GMFZQLV','DSBYFWGKQRP','OKSLQUECSIFYKZ','HSQWESAVJDLINXQZ','KNKSNMHISGTREFBAPYOY','MYNDRKEZMOJY','JMTUWXZPYKJA','WMYRZZ','ZWMBGVZUX','J','ODBT','BTAXXZCTOGCYZQ','XUNNFNWSRLTPMJPFD','IOJUDXHUVDFLQ','IWCTLMAAK','EUPCXRCH','BTWYMHV','LHTILDBDOIAEPCTDES','FNVZZIEBPBVH','VKWF','XFIHRDLRIANSU','OVQEBIKFAZLU','KIWIAQJ','VTMFDZELACMCC','HYYKOUVOLFEUUVTLKXQ','TMRTGV','APFAJVKQDXWHQKHUMX','RMDXJSWKZ','CLMNGGNYCOCEWWQPNETQ','EZC','HZKEARCWVRFYVIIEVEP','LZVOTGOJKGSEDCYZTL','SLTOZPVYLCTY','NWCT','EZDI','FYQZYTGEWRTRCKMFFXAL','MNZFJM','JDGETBAYXINCKQOHVAL','FYRAVEWGICVW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JDGETBAYXINCKQOHVAL'))\r\n%%\r\nnamec={'TWFDIRYHKZDLJ','OAUTRCAUOBITSYPN','PAKWLFO','FVJFD','WGVEMOMLKYA','KIEXGQAEEOBF','BUVHDRLRWWUQODSWHPIE','QERU','I','IHTJCQAMKELW','ZZAKYHSVEZIQG','GQSPFNXGZMIVXWZKR','ULZACQ','UYMSDLYLWJQYOOGOF','GABXROMOVULLPPKPNLYI','OWQPFTJUXRDJXCMISMK','XSOPYVSLTHSQSTHQMQ','ERNGWNQQPX','DQ','QH','TT','FSTEFBNQWEO','MKVWBRBPDAQOTROR','DNCLYLKRHCAQNCDG','GZNENCWTPH','SKDFRFDQGLVAPB','DSLVXBRXPNEWVRKBM','SKLIWJAGBCTJXMKM','ZF','TJVTOGYRCCF','BEZOA','TCZKOHTZZQOFXG','CCXERZETXKLHNYCKJJWE','VVLGRRILCFDLZPGO','RVRAPLCQUYVRHMVZ','IESUGXPJKNYQTMZCVRK','UOGRYOVPBJPGE','MOQS','YHEUKZHUTTI','MCRDTEB','COOEAYZCBH','SOQAE','WMIYA','TLBNUDLE','H','EDWEVYPFKPBDXJDJBA','EXEYTHVVOSRRCQOXKUNG','CBH','ER','IJTMAL','VZJERSOJECHSEIIMFF','FGUJCUULE','INLHAWVTXSOBGKJYSO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IESUGXPJKNYQTMZCVRK'))\r\n%%\r\nnamec={'IOEAKZJPRPKTJNOZB','ZDUMHXJNYNAWNLJWS','JDIVFVATR','VAUXI','JQKKVNTFBRHSBJ','YVYMIK','AIQXIMDFGMSSRTYHP','JRKZIHIGDJOMCPY','LOCSUGBZ','JDHKURUFELAHR','CCVOEQYXGOVAJNB','UDY','AOENHSMZWG','MUZRGTCEZXFGJTAKAKHP','HUJASMIYVGGXLBQ','PIEEOUGV','WQEHQWVXPM','VCOGCNVNRS','YIHHJVFZFE','DZLSACBUF','HNKGSYTVZ','ESWFBPOSHGVJJPZWZ','CWJVGEJBTXXZZM','WVZMWOABZPQ','RITAGYKDRKQ','XTMKTHWMNONMJVT','ABFYDJLYOLM','WCLCVKQZYA','BWTMWKMXPS','CNGQQSPIMSKEVSHSA','TWQXHFWEELMHYTPCBK','LMI','ABKAV','HONTGWQREXDXIFX','HF','TNLMBV','WMLVS','RHWJXBG','EJBWKITPT','PAIVD','ZGNNXXNHYJAFA','HOSHEELTT','XLVQ','GJJOP','USGTDZT','VQYRFAKIVB','RAOWZ','KQLWBYJUXWMQZNBVRZIZ','WJSJAURLTKMFLYEWL','KCS','EJPJLYFZZXZGOGRQL','FNXUQATQXZFOFQ','CDDVYFLVH','LNSED','CZPKXAGODGOFBRXWH','VLDRWIFTLYNJYVCWLQRJ','OKCADKJXABSLKP','N','FMLVZNNHVWIOHTROTIHR','ZSLGUEEIBRZO','YF'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'KQLWBYJUXWMQZNBVRZIZ'))\r\n%%\r\nnamec={'ZHRKFFVTV','AANVPJKOEXCCV','ISEFLF','QKPAVCV','UFTMUOFYH','UEJBWOMUWVAHVOPFZFKH','XFYUAXTSOIPXJNTWEMVR','TCXGANJ','LZJDTUVDUSRFRBJVXTRE','DKNY','SKTAVBVQWUNKGSTH','LAJUEWXHWXN','UPVUPDPHPMMZK','PR','SKWIGGYNEQJL','ZYIQJEBIT','VPPWWZ','KFKDDE','ANHJYSMUAGUDLLZLGA','LTPOPUXPZXQLTF','PJLIPCUTNJAJ','BZBVKHGWXNR','VFMMGXMNRCYBLQCXO','KPYV','WFQPYLFRDLQLSV','OXH','S','NBNGVZVPT','GJZRZGI','KPWEPURIZPHQDUBXJ','VQJRZEPDCL','ANCGGFSXOOBVWLQT','PLYUYVFUPJPI','JUPDBAJHBWTHJ','PMIBCCWWAIIXIGFPJGQL','RDHEIA','UIVWDFNZFW','NHRTMDVL','YQNTKFTZUMJXSPKPVGHK','K','VVRA','HNRSPOPCTTDMSXPRMGXT','EVYRMDRCK','LUIZ','P','JXOLDLBOXK','O','UHVCWYW','TEABOYYTSAVDXB','ITZKZSMJMCXBDYHW','QIQGRVCUTCJ','TBRYLVVFHOAXWXE','BEGAPORIDU','JLVDPGMDTE','FTJIU','GUVILARGMIYRLPYR','OUJTQOHF','PSUVIJ','QVFZT','OLBISRQC','R','QXVWIGCUUKYSMO','JUM','AJ','RR','JEJAKMJTOINCNFIHG','SMTFIGBRC','ND','CVLGLCGSIQSJHIOP','IYRTAIWPRFYIIWO','VNFVKW','LSRGYZADGAM','IB','NRIVKGDDT','ZQQJZODVGHTLKH','SMVTDXZXVWYDBLY','TDNZHBGP'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'XFYUAXTSOIPXJNTWEMVR'))\r\n%%\r\nnamec={'VAJSYAGAOJIWVEJDZGMI','YONPJGZITZJHLBGMHP','QHEYGNWOSH','ZZXOUYOYUGZFHD','CBADRA','JOJOEOQIM','YIOWQROUDIU','RUHZKCBBKCFNUAVEWW','FEJJEIWMHLIE','GDTHNVFMFKQTBAAHJQXA','PEXFTBA','ZNE','C','EYQFRQENRMGKNOWBT','MUZR','VRUHHYX','VCCI','IOVUGNVRQMWICRZUAEKL','WSRGZ','OBCFVASFRJJ','DSWYSE','IBCTTSZG','BHWWJCGFD','IWZY','WMWWGTDRUXNAM','VEWRGUWKYXYTR','DIWZAGDPFXAZHBHTWDD','CYYESJUIZFB','GVT','QRDYACFPBRAZ','FNQK','VHJENXP','WXYVKOVH','TIILZLAYPTYK','ZGJSV','KHCYMARUVUVCQCCQTJH','ADVG','JUVMQXUCCTBXKE','EGRPHHXLHS','NBDZPHWXFHNDKIO','XQYV','DFKNQRCCXZFSCFDZKC','GE','UIYHHSUFVKKCYSTUENRP','WSLZUMBZNNZHMYRCJ','BLLWRXTADEQRWUME','NVIIH','DZ','YBSHAVJPKJSOSIKZC','QCEZCG','TCOPDCOZYFB','FLWPINXSISEQMADOGXD','ISDCYUSAQTI','AWVJF','TFZPWH','ZWOTRPT','KVWXCOJVW','OHHPEO','KJMCI','TWEIKLTAWLWPFHQVYCU'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IOVUGNVRQMWICRZUAEKL'))\r\n%%\r\nnamec={'QYNQXKWTBWLQAV','QFZBOBFFKUV','SATCT','B','OEU','EDYMJLOSFVXKB','XPTUMA','YXQHUTMRWVXCFN','C','NMUKSZQAARPYKBOJO','VXSUODWMJEOFRT','TQFODG','MVAOPPXKPOYLKZP','AYOSNWPTZNEHFENU','HLAOZUDPGO','BVNYHTE','LLBZFACMMNT','FDCGRYMFSZKECAOD','PCGVWGPEKPRE','T','IQU','PHAJAXB','JZSWKRHOTFWHB','SXLJKBGJNSDVE','ZFOGYXBE','XDZZWSGBUATBEK','IB','FTUTZJGKFHOWSYRC','QZZQZ','RQHRGEQXGWDDVSC','SWAPIZKYUQDUCY','LAQKSCDQQHUHROUPZMPK','KUHXDFAYDTCFHE','YUIGRMJCHOJRLETBLSPH','UPZVBPVFI','GC','MDBPULJTNVIBPVKWICXY','WVQETK','CONDVZ','YFNHSVAQOSVWUG','VOZLYCFAH','VDCQAHPSI','WOJGQPZHGJCJZODPR','RZGYDQOLMCZMBQILF','MQHZBD','QNZIDLDMZOYTJNBDVLK','SWRFWEZZO','O','BRMETQKUMPVZ','BOHQXMICZPIJINBAMM','XZHKWHW','PIWTIMWDW','CSPMUYEFTM','WKQVYHCSKLCGA','FSSQOLQOPVTPSWX','QAILVSVYMY','ZMRDNBAVH','EDLNTXXI','L','FPT','NGEWBBCXSCAWFZTIWELG','AP','SUIWNKPKEIV','AFEUBXU','SEQZZIPOXRYFSI','PNYPEBPJFKU','ZJORBRZJBKSRPGZEC','VRFWCOLARBSMCCETVOOY','BBWSSU','JHDXBKEBTBOFKCQKKGD','VBRDW','CZMEFIYGRXBIZYQAOEB','RYWVQCXMOTJXRE','ASTBGVNOWKSD','FZ','OESEXTKXKGXRRZXAAHW','GCNJIDSJZWV'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MDBPULJTNVIBPVKWICXY'))\r\n%%\r\nnamec={'OLBECAKH','WALVIPXKS','UKRKEEKP','ITYJJEIAJLK','LXFEYKGNJRXIAATYUH','S','CFFQVCOZTQBCNKTKIKJ','ADMOLGEQMVHGYZGS','LUIKBIIL','KICCEOKINPQZQXRCT','UIFD','HRHXRIRTEO','POJWXUJTLIXYJUTSP','EOVOWA','HVEVAOIPQHTQWN','ECFXJL','XYEIYBVBPVVKFSESTXO','RTRAHTQLTLKQEB','LPGZRDYFIMXHMOKTGV','RLJUFNHRFMHJGEJKF','NYKPGIMSJNI','SVMDJTMHYV','OLITWNGCMC','QUTJMRHYNI','RIVJRF','SREBXWFBLVVBM','NVYWUKFVPXYQG','NDUGBMD','PQQ','VMWOYCLPJ','OAUXTTK','JJXNESUVLYMXI','KCAZLCEJZ','GD','IEN','PEALDLHFHHSYLOPPVIFU','RIPLRWHJKUXK','VGQUYLBAHIQVQNDUBBIE','WMYSOG','YQZWY','QJJRZKAN','BGGBCNY','HMVFIHNDWALIMJQVJ','JRHXWKGQQFDHQCVQFV','JBWXLCQ','U','UNAMPIJF','MEVHUELFG','UYBBK','VRDQ','BBEKHE','DDOKPNHLFXBERY','HTPDIXJZYTYUMXSA','YFEUGAHWQDYQXZOJHAA','PA','QYKNVGZTGY','EU','MQN','QVX','NQTHFIMP','PVXZFAVR','EHXNBUURJQ','KMFZUNNDNRVEOMM','ZFUOZTXEIKSFIUKGPG','UTOPZCQLLXQFELQHY','ZWAPCWIRETB','ODSGLVJMCQT','FGYCQONLQDRLNXXDU','VWRMDYLJAA','TITDVATQS','WDQLGGUTUCYX','ZQLXPDNEEDARDL','NESRUPLFJKZEEUU','FLLYHOYZJFVXKJCWART','ONNXRSFCTNNH','YPWYQVYD','KAK','PUDMLOAVFUZEOY','INPQ','BMGWA','FULRYCCYXAANRTEL','EZZVVDUQZ','J','QVF','PIKBTC','UZCHTCMK','PA'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'LPGZRDYFIMXHMOKTGV'))\r\n%%\r\nnamec={'THWUPQDIQCGC','PHRROUTOWKFBLHCMTBJ','FFZWHOUBDJUHXCQER','PRVUGWJP','OUTCTVJWJQPL','GTK','SQ','AWEJFQMXOBZ','XEGDMNGQUBRRLDH','ZMNYRGDGAXOOV','CEQTQEHJ','ZVYCZLGIFQAE','GKKYTXEWUU','GYKQHFBAYMYJOQ','ZWBFOM','Z','JRQMYCXC','UBCUROTDPZ','V','EWSSKGQGPDWU','QFVZZOTIXD','LORCVQQCFS','VZXYJFGKNGEDGZYJBDD','ZMHTRZAUMQ','SWS','M','SQ','YFZTAVZ','MME','BNGNTDVLNOVD','OWELIJBQLIPJELRCBWN','OYJUHFIWEZFFXZJSK','OJAYEYQRUWEWEL','EZQAUNFB','PPRFEXORKNUZKYRPGL','WMFKLS','O','ZKUCHI','UCQGSZNQCZBQO','JFATSOYNQHPY','UGLWWJLKXTMKMUJC','KECCXUIK','YRDKCXRFIBOLLAXBE','KLMCF','SOGOJXJLRDWLAWDUO','VKDYIGLD','HNLFTM','YPCWFOTTS','DHBFCRNIPQDMPRYUGGSF','Z','PYEOXJXSQQXSZSLPWPBJ','VHICFAEPWBHQQNZWUFRL','UTQGM','HZQHVIRP','TOFXMCSPXOSRHZCTECPV','EMRVAZWTJNRCSTUOGUPP','OLLEHNLX','DCVDNPHCJPVWKMZFJQ','F','YIOJIRL','NBMIBAJINBAXVMKLMFVJ','HKQSHURUVVKX','ABQYBBPFEEQQC','ZPNIPVYDTQO','BICYYSSEXWA','ICYZSXXBBAOVZ','C','QMYH','TDAQVASCMQM','BOCUUTAX','QSD','AOABNRE','ZY','LFETHZKRZKOU','LUNDNYWWQTRCUALDFACW','UJTAEMHDBKITB','MUGDTHGOEGJB','FUWZQEVXPZIEWJQVODQZ','WKG','TCWKECYVIGXY','IHFEUPHBA','VBNJXRDJACJXCXVWBU','RUUSZNXDIZ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EMRVAZWTJNRCSTUOGUPP'))\r\n%%\r\nnamec={'XHS','WZCIBW','PREIVONCYXIZGZP','AEGSLV','FHXOGTXEVVVRJTXV','RXHOMEOTXATLTXBL','XCBYOQUKHHHYAO','PLVIEU','EBQQAAPVBJFJVQRPD','SGRTRBFWDE','TFFLUTMWYONKXMRDIHB','GMFCNLRIPZMXBDMOZ','UAJNMJH','QAXPMUJXEBOYNHIT','ZZW','AXIUPAFWNZXBTMFUW','DKEWEJSZGPSVNSDU','IEBZCGKAS','OGBYKPBYQWXHNGZINIX','VBCXBNNH','OBVVWQLIWS','NOSXD','TZFNK','YGHAAWVVINCIFVOGXWKT','RQHIFXGMQGDIUY','DSIIBXODN','NDBKMRKUOZSLZALHQTC','CGNEDRZIMLQFNUI','JMEJXLRN','VDHTQHPFCZACHS','YPSOTBGBFHYIYN','YVCNHWIYH','AXZSIOHJVA','URPHIVPD','MCR','YRKRGC','X','KHUMUNTDAKIR','DBXJJYUNAWQPFPSI','BTABQCBZ','FRTKUUIUCWNQAOFCDZID','QTMRQOBSKNXPLGYLICC','TWHNUSZIF','GLKROXO','JZFZXDRQOQFHXSTLGI','MYNSZTOAOEPJXDG','JW','IHZKXRT','NXCTMPGBVHRNQLIWMS','LNYXV','EUR','OOIVOTFMWSMZEAGKLD','JTJW','NELD','RLHASFWXKXYXFFAUUVTN','QQAFDL','VBBORVQPHPJWN','TNTQDKJHORHLNLXJC','KIEYZTBC','X','TMVAVQ','L','KZFJGS','V','PAXEXKPY','SURWLRNTQPLUBJ','VXXWUUCFP','ZZMJBVPVDBHCNTZORR','POFFYC','BVCIXQXGTZNNA','JGXSGKZNRZSOTM','MCREZTN','ZYGBHQELCNWP','RZOACKCLGHR','KFQGQGCDFCZMZMA','KAEMYPLQOU','ZLCXJAJPDSAXFES'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'NDBKMRKUOZSLZALHQTC'))\r\n%%\r\nnamec={'QFUAHWIOOKR','ESSXWCVAAXUNPKZBP','XOHBWMTZWPVDBTZK','ZZIAKKZER','TCJNAIFFANO','IHFDHP','ZXVEQXNTNPI','XNQCBWRJOYWNPJGGYOA','DNXYBBWQG','YIDQFQKDCYQ','DOPKJAKR','PCLIEY','GTL','HFJ','I','SZCDBDD','MUKH','SDUFF','QQUNPTRTNRGEMJHMBUZ','TTW','JTF','KLVWALNQRKUIBBKFH','VQRKGXQII','SAGHQQFQ','HRZXSDNB','AMJPRLRVVPUW','NUEHDIBHCGJNNXODCSYT','PFWMVZJRQR','YG','SNO','OTPEWBHKRLCXZOVQB','JJJZPVFVFWF','HZVUBNI','HCANPJ','HFPROKYIHYAFKAX','SFWXOTAIUNXT','JCGZXAZALLS','ZDAPDIF','XQWPRQOFP','BATBRJYMEPH','HWLQMBPJR','ZFXBKAVDWCFKDVIPZP','DXHHBTCMUMMHRITW','MYUWULXGAMCXUB','RUTVCBDKKBKVCODTE','JPLGOLTIB','NKVYBPZFRTWD','DIKMPNLVRWVGP','TZFGVBXIVVKCN','ZQVV','LYUIEEXPSCVGXPAXGNOQ','TVDFNASELMQBMUFRF','TSAE','WTBZJNOXQMGJACUF','ORJDPAIHTADOOOIMKJR','CAFVCRS','BW','MSNRIFUX','XYG','DXNEAWGNPEFEI','CVCCTO','BKKRJFUYCMQVACQBUH','OUKRJQKTHTEKOGWNAJL','EH','CBVJJGAMPB','D','JCX','GDNERYKFLCEMFDGHBLIA','ME','OCVXQRKNLMDIPG','DKXJ','YIMDAGHEBVBDEQLWQZBU','RJOLHANYAZTAXYJ','UOGBZSXATOR','RPWKKLKMITC','ZEMNOKORQCIGT','EZSILXKGHAV','EKYJYDR','LYHVGIR','GIRVT','UTNQHEBGN','XCIRJWQPWZWDJMCHBA','NMAATFTNDCKEKOGY','VRR','HMPLHONBSDYSPYYA','CETSSXCAJBG','AACEYNLPMBJXZSX','GDETCLD','KRVKTREYTUWLQKCQGFNY','PWSNIKIOODMZCEHSS'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'GDNERYKFLCEMFDGHBLIA'))\r\n%%\r\nnamec={'AYGOJBGQSGJ','UXAWUQATLCHDBW','EMWESHWSFIE','LYDDIYTAFWCMZFZAJRI','PHAZNAPRSSDWVEICENY','LDXHZCQWCQKQQXJXCL','LYJTSODMNVPIGOZA','JDJI','QGFJ','Y','FHJQVEURGXMVQ','BTPBCD','AATAYYOWE','BRUVNITJXCXJHYUWZ','RFGRZELSDAEKRSP','RKBKMBECPVJDPUOOYZ','F','C','RESFUFHIJMVF','GPJXBWH','QCJNXDPKIZHUXDTBXF','DLNOP','G','TPRCBFEBBLVYG','RWIWDZLDWSE','CXBTNANPRQUAGKX','LHRGDVJRJT','DOHFZ','JQ','GHRGNOJ','ZMGESBZULEBZAPYLPYUF','Q','JZKXJTOBMBUOS','ZPDMPTGMAOMTA','X','Q','ZRXJG','VHRBOCEJ','DNPJ','TE','W','SSBFLCL','X','TVMWRYCCTPK','TSPJCVTUO','YQUOBBOVIMFZHRPAPD','BG','USIHMQUJNXQEBBT','BJFQJME','HHBFBWYBVGJLZSYKEUE','OXMPYRXDVDEFETK','OWRADONHAWNMQWFLOC','FLBZA','PDTOJDXJHOALT','XUIDOPAMCTYOWN','BIOCHVREN','QSONQOLLM','ZOHOAV','NMVVYUJDR','XDLH','TWXVFGJLNPLOQJFVM','YNSCRRKGN','EYLZ','YLCVZSWWKT','WKAVXKP','ZJDAIPTKSFN','AB','XDBZLVICXHWTIRJIRQGT','MCBDWUSNJNQWWNQPM','USFGSEZEQ','ZJPRVZNFVSL','FSQFHXFDPDVLLLG','SPDFIBSWLSQRO','ZHVWZ','XQCTIIQEEPEFDQYPZLMJ','HITWONOWQ','LQDK','HGR','DMA','PKTIITITLQGSC','WTMYNMBXQEFQIYHGNHGY','RHNONCQOYTSLBLERI','ZQ','TYZZBXTJ','RRQXASJHEPCG','EBNTNHG','IALSDUFLNWX','OADQT','ORS','LBYYIXQJPSSYVBNN','KKAKFIWWJIUUJOGKH'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'LYJTSODMNVPIGOZA'))\r\n%%\r\nnamec={'JKO','OWGREQBHQQUMLNVUWQBK','UHVVBFHIGRXWTTAMJJKO','WJX','SFIBGZXGZUEM','BYSUOAWXKPCQSX','UPNYKWBRQSFGCGUZITC','ITVPOFOUKJAPQX','WVTUMGBJBBUWFZDZBX','CQZCXRSQ','KQWLOVEPOFFEDVG','PVNRITWZIAWKAA','DOQA','ACAPGNWKVMOVE','CWEFWFTQN','QVPNNRXCGHGMLKWAT','YNPWDBTIJYNG','YEFAQDSSZ','AQHQWOIRP','ZQRZLGACEUJSTROOGCJQ','SPL','TGBWXKJQJMW','NKBYESOH','YXYE','NXVGP','QRCYSWHKJUUNGEM','KMIECA','HXCGAIWRKJDQ','EVEMIQWSU','ORY','YHBAHCORMXPHBPM','GIE','ESSZLCMQD','PFNO','UBLFILHYXVAXRBVPTQSN','PYVGVUUQOCWW','VIMJNOMMZVWIMAHG','FURZKEJESYJB','FDM','BIFNVLU','T','AVCYWH','QQF','QK','GPRHV','GTOKJEMWEFGVN','GAXJID','CJHJ','APLORUKKCDHKL','XZPWEXZW','UOXFBFQXHS','GSJHWIYHAXSRPHIGG','G','OLF','TU','ARRKPSRLTB','KKFFBDJHHGSSG','VHNQKMLOR','YWXRSYYRAFNYDWRQA','CKVOWSUJGGXVY','PSUI','MUXJMK','EYTHUKVEVDFTJLDC','OOKYLAR','FTJNSQZVECEXE','EHSXVDTVNNYOWLL','UQJLAUKPOTTJQSJKWUX','JMSIXWHFIQEUIRAEY','XFIBXKZUXSLUIXNFWN','MNMERG','DLTERHWWCZDW','YVSISIWYDEHPARNM','QXI','CHFB','HSYWFLNPTX','LRHZFESLQYKVCHX','GD','JDQKKNOAMBFLFPXVMMI','DKV','DWVXMWJWT','FZM','TRYYOIHQVSNKVLCFRR','SK','APE','JNYDIADPTGRHTVWV','OINTXWT','MYSVMYHMUWAB','JJKWZUSBVXKR','V','C','XHCKOGAB','H','WGY','TEKKJMHVZR','DHBCBLI','DHFFTEMLQVWUYYSZGZ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'UBLFILHYXVAXRBVPTQSN'))\r\n%%\r\nnamec={'EYDUEHDLGIIFHA','XNIGHCY','AMLXIFMEBCIBX','EWMEKRLKZPZDXTT','LXYJTDUC','THUQYBENQVIBDTONJ','FMRIRMQQLHTW','PFQHNKKDYQI','PGCEPKNOHRAPVWKNOZT','CYDECVFCTMAVIP','WWBBORAFBCTQAJW','EWGJT','UCXMKAYWHQM','U','RB','BSBUKVUXOYEPWHVYGA','TKCUMOZNCSDEJ','ZAXTHJPOBNNWAU','EJYVWLFJQTUZPNV','YJJMKOZYGHJ','QZKISVFTHJTW','VSAWHHKYNRZYEUEIJJ','RVGZSNCHLCAKBCEPTBP','TUH','KQ','BPCICNHHES','DZSKRLZJHLRUOZBPCPEB','MIJWJNMJWGSEXRN','UWMSGMUCTRDYV','ZNUWDSZQQCZF','HEHFIHHCVNQDZJW','TMIUAPEQXYP','BMVTYNISYOOZEHLEFBEJ','NYYVNSDKJPA','EKRYBQPXC','T','RUBGXOTDRVMCSEBWP','NBLAQIPECGQ','XQFOAQRKIVM','FKDPYSY','TJBVPJOBINRFKVGU','YRPAKHWHIMHJNURPEKXR','GTMLLKGRSFCFXCJAMO','VZBWFUMLUCYB','ZNOLDI','LRTPCKGBHQCGJWADSCP','AV','ZNNKBC','DEXCWEMD','VRY','HMTWGLNLGMYTPZOCU','SJMKNBWQZGUODYZRAGA','EEQLXAGGKYPX','YLHLRDB','GSXSZPWALUIX','IVLSPD','RT','YBBYZ','MOKXBR','XBNCBE','ULCPP','FNGBCWSTFY','ZIFTHCMMEO','KNLFCQFIOKHQAECVCT','A','BNLUIXLNQP'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SJMKNBWQZGUODYZRAGA'))\r\n%%\r\nnamec={'WGYEJYVVSPVTUTIJXS','UUQ','KK','HNV','OHN','ZDMRXCBS','O','FSNHUPLNIDWJEGHBT','YWSMRUPRO','AWQQD','VDJJS','CZFZ','FMVEADNMWAGZWDAYJN','SXXGRYDF','JR','NRSVCSNIFGIPS','MZH','MPIAV','KKWMUFUZLLCGGBDVYUI','DPYHLZRVREWMVPRUEP','MVSTIJD','GUNJ','WBYOQS','DGYHNMEZDOXPPVQ','OICYPYRJIOSCWAAJONB','CRYRIKGQGKOQXYDDNG','FEKWGTZXNEXPKNCJMEX','YIPMUZAZYTV','VGLXLQFYASS','WO','NICUG','PGBZKWJQSUB','W','PC','RIM','CYPJBH','CZEY','MNYOFOFCHJJKISS','OUVW','LZYPTUYWEB','FCHD','RQBHPP','DHPYWWOMMA','IWYBPWUKTNQGVKGZC','ZJTJBZNGZJGJDIR','QSCZQP','WFOTIGIH','WUI','V','LZGMRVPLQXFQCTBCR','EBIEDK','QJNVGBMNMUGBZOZO','DAUURYORURRXCZC','IIJMVNCTOTEJZIASL','FRZFGSBMPC','QODAJXGTQYG','TQNGZJ','BT','ZCSOEDSMDDL','LFL','MAZAUJGQKR','VUPIXAEKXJ','MJAIVAZWMIAUGMCJ','ZKENPXEYPEIPAAUSSRGK','HYTQUHOWEU','TQYFVCMNCCBWNKVXBJ','UEL','XXFQJTP','GBDICDZMQGZB','EYTIFRXVXXHYMOPKQDLM','JHNXZIYYESOF','BHQVGLMSGUWGCDDSQ','NQMIMXORB','QIYGZSPCJADZVGUK','IXWNX','HOPAJ','FGZPNTQNLLACJNMPVHVE','SPGKGPJDNTHBSJCNS','REHDRD','RLTRDVVQRCE','GAIKLPUP','KWSK','ATJQVAJ','EX','Y','KEZQ','AGWPYYDZNCNO','FOSYLAMECGMZYDGWJUE','CEEMW','SCEORKXPICZT','BLPVKTFEKYIPWIJRG','BFWDAMZCHOIARQ','TFSX','EXPZQXEDAJYRYDESCLY','NHCKRRKWLZJ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EYTIFRXVXXHYMOPKQDLM'))\r\n%%\r\nnamec={'HXYQWEZERXBQFZECZB','S','DMMXSNMRHULVYIJW','HJNZMIEXBLDYQJGFI','MHSOVFVBKINKFJHUIAC','QXUPYMVPVJTU','DMZQFZKHWTHMTHGWYAM','YBVQQERRHBVCJHSROXNU','VZIQAYEL','NTYENEAFAUEL','KXRKXJFBRXXDUGUZRH','B','WDNCGMMYKFMU','N','WAKHZBTPTSPMKZMMXR','STVWJMFSDWTXXAI','TXYKWFIVOYBDQ','EUUW','RMTJBMY','UM','PXUMUR','LBPMXANROSK','TPWMFVZDGKXSAKBEDI','BGVOPFMPPJEWBIOZBNF','XGYKCKUZQDJYAGG','OPLGJT','PHMNOKB','MADXMUBPA','HBWMJZ','KHHZOQKAMALE','JQQIPY','RILSWUD','HRSXFVPEZIIV','ALYJ','KZSTZVVFTYLP','JTN','NOXKHEQILSJGJI','GTOCIJMFH','KW','YHOOKWWSVDGW','HB','NM','QMYRYVR','BJRRIXF','DGO','JU','DYLBWTNIIQBRFK','QKXGRHJSUENSBAVCW','HBCH','KDXTAHUESOKNL'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'QKXGRHJSUENSBAVCW'))\r\n%%\r\nnamec={'ALLW','LNSMSPJJY','RILSPNVFLULVXZVEFFBT','NHPU','QOAEOLWVQ','EVWYDNSUOKB','LUFQUUUGNU','TYYDKHYTYYEJU','TNAAFIIRG','PLLSBFEHB','BMUG','SMKYMCUJKUSR','DVNVSKRLVTQKKOMBDQM','UOJVZJEJECBKYTUDHXYJ','YBATREIH','RICJDCNUOZQV','CKJWAKLJGTIRPRAXOCQY','ANHKL','MOHIUTJIJHPAZAUBY','TDMYDRBFRZBYOFIOHHH','QYRXFHJXVYTSPNO','FOFMTDRGYDP','AOKHLHXAZJAPVVUKZRGH','BQEZMUFMZWEGVTHIA','TWZQYUDBUBCGUK','ZXGMHKSARUPAEEWMIMP','CJMWHCDRTS','BZLQQIOQELAEXI','BSCKWYRQE','PTUDPBTD','M','NQSFMDOU','YWGQJ','YTVGJLJQEUUFSC','XSOXR','NWHP','OBZWDZENZD','FAPOACK','QJEOQ','URAQBEARRMWWJP','RSRXVXJAQJWG','XOULTQLED','VMMMVDXB','OQGOOWPVENYYQCGHHK','SOIXGLQIAPHGVVO','E','DCESGRNXJ','MRKV','JVQUZIMJUQTXSXV','JQFCGOGSYYUPVVRHTEHB','JYVURETJOGIDUG'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JQFCGOGSYYUPVVRHTEHB'))\r\n%%\r\nnamec={'GHEOXPV','ZHI','MNFY','YEWVTZJ','SQRXALITJVBJBKOGCNK','UW','VCGKSYD','LACBYWDZYRXUUMDSWEA','BVQBEXXMHPKBQPT','JHAT','ZD','A','XNEWHBIDQ','LBXERLUZYVJ','RIIJASYOPIVQQYYZ','YEZGD','XGT','DLM','LWXZHBIP','ZJBWEPIBCOE','MNXWRV','VHNV','NODYUAZMCNFYMBO','YGEPCRFJXSDDSSSPXP','GEOZMOVT','HNMWNBRLIXS','ADZSBCUVQ','FNHGFLKKEVWNP','BQMSNJCTSYQSHYQVT','CPPHYPDVXPBTLJBCV','HVXIWHTUBFRQ','LPGUVAJMLLFNC','CBARIUY','KZYTDHXK','JRVJSZM','ARXITRIJEIUCPWNSVGSG','F','JPGNHGAAGM','PVNPNDFHSULUZUGVMM','TKLQI','XWMBFIGMYRIVHITGKASG','UDWHDNWRSXWA','OVCEEBENVWLXWAADU','ZTUBMITFAPTYKXUO','QTQIBJAXBZFSNZJO','RZEJKYUBSAZIHUZZTEBN','T','UCWBQVB','WSFVAWJRFDUTNCH','WKOVPHAEUKB','KXNI','MIHKTNESPUOCU','RTEQLAVBCBQHBLTU','SAABESRXBX','VUFKQNNRDEKTEUAPKL','DDVGOWCFTHGEUPQ','TFGPZG','RXUQOEXSOXYE','BCSOJJAGDOXJHVT','GBMVF','QUF','QTZKJTICPIKNX','UHB','NYUEWII','NCQYPHQBOPBZUYHCXAK','YADQSMQRSMMIITHHFA','MBRCRQELQGKCH','LZZO','IRIG','EEHQAF','JNPMVWWYVIPYWUYTHCIG','MKIBIHSMPAZPTUNQDVTT'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SQRXALITJVBJBKOGCNK'))\r\n%%\r\nnamec={'Z','DHOWAIFQBVLAERDIZZR','OI','IDHDDVZ','NZLLBCKEYOOPJ','MSSIHR','KYLNPGPUXHBEAEGEU','SKUS','IRNRYAZYHCBFJ','QX','QTCNBH','MN','O','MXZEKVRXPZNGLGBRZDSC','WKOVYXZ','SATCUZMGUZ','YXF','KXRRN','JP','ABVRKBJADWVVELBWGL','VWJ','FSTDKVQBRXVVOMZ','PQEFIDQCYHQDDO','WJBFZVEMWRDU','HGEGY','ASTQOOAHJVE','MDBQSSTJKBDJHYNFS','FHNNVOCUPXZMFNIX','RDZVE','PRNRM','WDQYYBSTFHJ','V','HFVDSTNTWSHBARXDRUB','FCFSUBZSWUSKY','VIEJQCXLMFIBGLG','IQVJMBBYMEQ','RYCQYUO','CTGERJCSRTBXYTRXBO','BY','OPZEAXLZVA','JRACFXQDLK','NBKBZMHLHD','ACOVTFVJGABIZO','I','NRBGNNN','VQTNLZW','SX','LZIAMEGC','WXJCY','HIUXVECXYWESAHFA'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MXZEKVRXPZNGLGBRZDSC'))\r\n%%\r\nnamec={'FZPHLCQSJ','ZJGB','OZEAVWJBIXGMNDIBHB','YUJKVLJUMREHVEUF','NNTS','PSXIZYTGWVQGCO','ANSZYBJHVURYFFRO','DKMKYZSAGDLS','AOMQHNPDDOJIXPBTR','LBJEQAY','LLTRPZUNPX','WYQPBSS','RWRSINKDCVGOJNLDY','CZNT','ODPRRYOFDTHNEA','BMRAURNBMA','XH','CBEPGYFUSLX','PM','YR','GPERILIKMEJBM','ZLNQVLPDTYDXFKJDN','YNJI','VQRYWDQZKL','VF','OCWRLSNYXBKGAAPB','R','XBMBOMSJFMLTWHEIASTG','LFJUCYAAEJOODRDCKDSZ','QRSWJSLZUFZLWUGEXA','ZZOGMDFVXUAORK','NWWAELWYHUVGGNWBAG','MKELXTBXDL','UYREQN','BAPNNWTONMMAWRLPG','ACQZOC','LSSLSEZBGTCTHPYI','LLHJQHDYZK','AVHKKSOFWDMEFBLMZ','EBLAJKZEFFASIKNPVQZN','SI','OLZVNQRDOJACJIBTGVO','ITHHHPSNOVIFEON','PXAQYXXXGNJP','QOCCYQQIQOEOSH','ZBSLZMI','LBRRLYMAGVZ','AZB','HEJPW','IKPDOXNSRWFUQJJ','PBEIXBHIDAPZEXMSMF','AOQ','DGGUVQVWPWVFXYFILK','IOUMLOEBBWHUI','TY','LJYGUSMUVOOWE','LJECMWKCAX','YFZZYUCGAGWUL','KIKTMLRIOVBYXXJ','SODFBPHH','NEVZIFFIIRMTVDROTK','KRFFXGUW','TKLPKQVSQABGWJ','PFTZPYAAAMWGCMQF','NLGALHGVHELLRSYMVYF','ILUVTZL','IONIZNOQ','OMQMXZWWTFGFCCN','WECRHJZVOEIKYY','GCWVGIS','NUGZXHADWNACB','KPBHZOOZ','SIPZLPMAXMVSEJ','GCGDMVXNVL','GXPHICLKI','ZUD','JOQEWVRQIYFDJN','KHV','GZMTURTBSJKWBBBJCG','HCPMZ','ZJXEEMZVCGPUP','EJSGSH','ZVHTHMPYYKDPILIZDDB','XJUSPSGWSXG','MFUPWZBS','EUHW','JPWGKNPJGDCE','HJ','ATZ','IU','KZTYEQ','YTQJOFASTIUQHT','PNACCYGUDBOWSQM','VEVJECRAOQIWY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'OLZVNQRDOJACJIBTGVO'))\r\n%%\r\nnamec={'YRMJICHXATZTRMJGAR','FKNDFFDBNZQRYNYGNX','WULIPQKVMQPRZUELHBF','XTWNMDKPSAH','HJXYQCTHAGWPICMC','OJKOGHWDOMMHX','NLEFJBMBM','NGPUQZOCKRIXVA','WSJGNDAGQHUO','YEQVSTBTYKTQW','FBJOFTUVSTLYXX','JJGUKEKOVNYKFBSZOGR','AQH','MQTLVPBSVWYUIELEZRN','LDLZDHCVLLKWKBH','MVZGDZCOAXTDBH','YE','TZSAKCU','F','XWA','RDCJXSS','ARRVMVB','IXKZJUAMN','EBBDOOYDWQMBHYO','ROFCLQUT','EDFUXWFQIVCUOBH','QMTPEIDOHXNEMUEBTMB','GNRIMIMRKWSRQK','CQUOEKTFWBZILEI','MHPZY','PIFDZOFL','NCWRELO','FMNFQSF','WER','UEYBYPDGXQAQETKXQXVJ','SLBWUKN','FMRYZSGCXQEQCGQPB','TNCVXGBSPXGNTDHET','MNJ','VAESXUHIBU','VUZRSYLATSEAW','NYGYKHJW','IAHCUOPIMEYPNZANS','SMPHROHJ','QKTHERTDFBV','ZEZZJNFRM','PAMPJCXL','AQBFZZQMNXIWH','MQJKYJWJLQYWIQIC','FADYJXGWRGGQDLCN','OZNVSOSQFYOTAG','UATQ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MQTLVPBSVWYUIELEZRN'))\r\n%%\r\nnamec={'OKYXOCHXC','WUCHNGRDZRBUAMKYBYR','KODKGIVSKXHNQQQEZKYZ','TXMPLWRRRTQXT','EVSLHETL','QWQHMKVVAD','YWNUODRFVUEZKI','BGCXWXN','DRBMONETDKXMHO','MCFUKSNOCEHQAK','JDBVKORRWAFZR','WDURIEMNLUFO','ORKOM','UKKPDHTHPCKU','WRTRXH','UEXFBNJNDTPKJT','SHDBQGVDATZNJGXMII','NSYSMFHI','GYETTAU','RZKRYICQAGF','WPPEMWES','UPJCPCZRM','LNGCVBZTYRJOB','SLNJWLEONBSDEX','HOHIMCTUIE','WOUFXRTVDKUUXBNYIBIB','VHGULPEBLOVIYKJN','YOSOQLWSHMJOK','SRS','PUJVLJT','TUKDPQAZARHPGMIUWR','CVAYCJFVZCYKSZGLEFBL','XPMQDN','EGVIOVX','CKWNOBHAIYYDCTQ','Q','HAK','GCVVXCLI','QJHHZXKTMU','AT','KJ','CM','XBRMN','EPSLCDVWQJMHJBLHELT','MKCZAUASYPSCSKK','WRUPHXMGDK','JWTLRTXKR','OFWYPCFLZOKSSIQN','YXLFUYUAQSGOXABAGAD','HN','RVB','OYN','MDGCWCOIHSAIS','BNAIMRK','SMIEZURUTTIDN','YVWMOWXUXGMXZ','LFSVJTJNIUYRYIBSV','WFIP','XOARJRU','LPQHDSU','IP','Y','WEGHMPEAJSWSTJIR','LYPLZBJI','UPNZWVOSSHKRSURGTVAC','WZSUALERZ','BVHUJHTUQHKNVRGRLE','GZ','CHMOLJUBXNCCOFBQBHHK','RVJSAWDMHDAEXR','RGLCMFSFMQ','NXTOXERFCYJYOFRBPA','MXJJROKRCQTCERFUSEP','AGLCGLYEAG','DCOLWJH','OT','CEOWMU','JWQEMMZFSDA','JLFSLCJRADNG','CTQCBVGZSWAZAMEJP','HJQQJT','QHCQRRRYOF'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SHDBQGVDATZNJGXMII'))\r\n%%\r\nnamec={'NGLZHUMADA','AZILUVGRZ','WMNBT','GYSTYVINKIECZMNQZL','ECXQTL','VWRTULBMJDO','H','FLVVGYTKS','AFBDFORWDIZYJ','LRMVQUDKDTFILNE','KT','COTJDBNMWYLUVWJMUJXS','TTYII','XHYSDPTIT','HOPTKJHZNOIIXJI','YIVJUYGFB','XOUJPTEEDKMLZN','DMZTUQVCPMOJTRCSXWTI','PMHQKVAJRMFYNTV','PFCFOEPHTFHXUT','QFKAFLRJIHO','XFUACXQTNPISWBADXJ','Z','HSHHZZVOKF','UIGBVNKBFDYA','DBOMNWNRYE','EXVHV','IUED','XBCRBVM','QPDIGQRWMLFCTFE','CZEIKFKXJPNZ','QZHYNGQRELFP','JQKUTHSVFJPGYYZGLYA','PDZYOAJ','CZZIOGDFEKVCR','HDWYLVTGHZR','AMEMKIIBFM','HGBW','MFEKMJAJEFBQPRPA','UDRBQ','KBHPSSTTPQCXULJN','JVSOGFJRRCWGQEROTD','NSYBMKZ','JNETACZUZJDNGJDKPQ','DHQACXDZOVTMQKRCBFEH','EGPZFGLFAZNKQCPYMOLL','EJNWQYTPCSKHROERKWFF','QNHBHM','LPQPYVADQTSKURQE','PBMC','BSZNGEOPOSEZOYTXDX','AZAFTKXUUSEIRZNXKBH','FYTLSIEVYCMQ','FVQPOZYGMTLFWMENJC','I','QWTSFHBPIDNGIM','TPL','DYXTKYWIDOEINGXLMVLQ','BBPMULS','SUMCQUFARFFPZDVSH','BKMRLOZQEGPPYZF','TOYOGVMV','PFEOBGZNXGKOYQVBL','KFMVTGN','TV','YXRYSBJQUUBGWJBTG','LURDAGYJXMY','GMZ','IVGOGHE','NOUDGHGPVT','XSLETYJZUXBSWG','SBKSW','Q','WHSPWGNDCB','KKJDSBRQFKHIYHY','XDHH','MLEFRXPCDXV','YJWCGHSFBLYPEXR','EVNOGUL','YAAUJWLIRJHFPIJEYQI','DQOQXTBBFXFKYUWYXB','AJFEZVMFYULDLJS'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'DHQACXDZOVTMQKRCBFEH'))\r\n%%\r\nnamec={'NYKFHEYGIWDRNR','ZMFELMGVPAXXYYSGE','KUXLNNNRBRNGFVTO','FCVXASKDIEOVW','KGAXP','DOGJMZWJGXMA','WZAZZEBRSFTYMKUHQT','UOIAUGP','WOVRO','NKKWPLXNP','ZXDOBY','CQLIBFYTM','ZUIFAWEQDTVLGQ','JBTZVVL','WFAVVTDYPPZMQ','QYNPYDXMFQBAIXEKHB','WWXIIDLQVUK','RRUNL','SRKKOARPCHQWIPX','TJYBMUSCXCSL','GWLQLGOZFAKFI','JTEDUQQAIKYCYF','GNKJBIXFQHLY','UFG','ZPXZXELZZJMAMKNO','PWFEUVLBHFNMLUHOYLKF','LFLNKCRS','VIYBFOJL','QLDDNBCSAFPLSRHUFS','SSKNUIMRPXH','KJAMTWR','DFGDRLVJKEVSJKFQD','XWWZXONGQBCN','FXKSWCTC','DMHNSYQLJAFYKEJNA','SA','LKSEEDCLKPVYYYUDSXJ','EKFXCNEEBAJAV','ZCGKPDJBNWBPRDJ','NOP','LLUMUMZQHXKEGNTTPN','YQNQVBQNJRWLMIK','XM','TLKAAIHFMCNSSPMY','RWKZI','B','KPVIQOIPLNRZBNI','ICTRPGEPIYQMF','USOYXNGXPHNHPKE','TTWXBSMFPSZZYXM','HKPWROFP','UOY','ANFXBYIFVPXRDJK','JREXET','LDSZECJLWCBHSQWTCAV','FZZBGXNBEA','I','WKPMIMHQEEGGEYTGAHB','NQGHUHVZMXRT','FRMNOJLMFCLUJENO','UVDTQOXJBMHHBQ','OA','S','IPYE','IR','WMULVFEAIHFJ','JPQZZDGRBAVNBAG','ETZQWSOAZMBLVQ','M'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'WZAZZEBRSFTYMKUHQT'))\r\n%%\r\nnamec={'YGOPOXMMGZYEXIZJ','GRXPDHIVZADUYKEB','UWUCUPS','IIZZSDCF','JIZJWUBZDTFTLZOCK','LKLGJWEBFOCEW','WMLRLPFZJHU','AIARXBYZVMVVYMZEXKJ','TQAJAEARSFT','HJUGNDUAHPEX','NDGVDH','EOSWLGTWR','SABZSXYDR','C','YQDEEKWVNUKURM','LFEYIYLUYQMDLILT','CYEFWERUNWHYV','VHNP','ED','MQAYYWFF','AKWOG','EOLJT','MWSITBYMRKEOQ','FIUCWARXBBC','MYDEFDYGXICH','MMYYGQVGFICUAXCRS','WWPULNFLHM','LQNFPWNT','CKVWCGQT','HDBOPMTUYYNHLTNSLC','WVZCNJFLSQRMCE','SUKMDRPWWDZY','SIOUVYRY','EXVQO','FSHXIR','EVSTROF','YNUOG','VKUGYGUJLBIBRDF','QYZDIAJCOAIKYXJOZ','UQNFNOOIUUYOP','O','IWVIYUDSV','RIAEQMJQ','JGXPONWN','GHWIKCVUUULEQFFVOUTE','USATQADSTPSBWMSR','OBBZWUMHMXPJ','PDS','WDEXWSO','ICOLI'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'GRXPDHIVZADUYKEB'))\r\n%%\r\nnamec={'VYH','QFSOIGSE','OCPFJTROG','ZBHEWWQ','LZJWJJFYDSDITO','ZUNUNN','KFNYNQ','IRKSHPFDSXGSNUOID','VQCISVNNHLNRJPNTXVQS','KRPEPCPGLKOJEOFPUOQF','UKOBUYSK','RG','MVPPBWGDTLRQSAFFUD','AJSMEGOQUGUEWGDWZO','MDBEAYZQREADG','LSXWSUMQXEMAQZAUZUH','GQQ','HJNBCZYQGGWZEV','MQPZDGCPEKYRDB','UZT','LZMCS','TODEMUWPSQBWS','WFULOCXD','VVJZKPOEKSOTOGVUSYK','EFXKO','NY','LIBOUCDINCXTPFKPXG','MDEXVSEEMXINRWKQNHIA','XFJDVCKCOFH','ZEBAJNOX','NJUVIN','O','TRCVTEZLWB','VZEFSLLUXYUOBS','PUEFRCWUOTX','KOQGLFROZL','PZIQXSABZKTASZMLZOR','VIANZLODOLNYKG','FDYXFKCIQBHRJAWLAC','LHO','QLRGGCEDMLKOHD','YMOJB','HBLMFTLT','TAL','NVXSLF','E','CVIARHWTKWIEEB','VVNPJYU','MY','GHEOHZYPRPHZLPP','HGATPAG','WKNRVYBTRFHCYGFVTU','W','IHSGEKQRADAZGOFR','LGZZZHRWJJQ','CMKVAOWRDNXRJWKDRU','OMNXOBJD','NDFF','TTMOCY','SUZVPFSGODKTYU','PLXUISCWQ','LKRABEVIJJOP','REBLYVBBCQWDEYW','KGAVXAOVWWOQLUTFLVF','VIEHXWRO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'FDYXFKCIQBHRJAWLAC'))\r\n%%\r\nnamec={'Z','YTZFCBEEJ','IWSMGCQOIKDVQXNLY','WTZWBQUY','AGSCPCCZWIN','WRBBVZFW','XPVFODFMOAICPGQXLYPZ','AICVNQCH','AGYSIIQVXOIX','QTXIZADDYKEQAZWQW','YKDDXSJXFQMWFA','WWUZJWWZ','RSBJNRUQMNWGWPL','CERSTMDEXSWDT','IGNY','TUDREACBEH','IGNSZYVWJBGMUUTFG','QSDDOZQFEDR','NEMNYZLYHAFWPPZKM','H','LLX','GZDDNQCID','CKFXPTAAOCWSDAAL','PBDWR','PTSTYMVFHKF','QVFCNZYBKZCWUYLBMWSY','BVNEMMZRUJHPZAR','M','PYTRC','ZRIZFNHXBRFK','MFYROLOESPHWMZJ','FSCXZYPWBEXZEK','HQ','VDMU','QPFUMPKPAICYPZUQ','FEZPFZYWHCTMEQYRXCXJ','VVNZAEBZVJFPYK','NPPJWNGYSTPRYMNZQGM','TWLFT','YVDHKL','RMVASPSAWYEDTUBYUQR','ELLALVLJ','XWBELWJUECJFSSEFXXJ','XMRVSMGLIFWEYQQ','KZSOGYLDSFM','UYYRI','VGPLZBXDJGOYMKA','WDRTIXJYRSYVJAAMRFNV','TFKNJUFIEBRXBDD','MNUXMYPQODVYJVPW','M','QNKC','FCSKO','ZILNXGNWQONPEUO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IWSMGCQOIKDVQXNLY'))\r\n%%\r\nnamec={'ADAM','BOB','JOHNSON'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JOHNSON'))\r\n%%\r\nnamec={'NQKNNWHFEOHSLKTNVFLR','BTFNVWMDRERYJVAIT','MAZTVIYYSUSJJXCASTEF','FGOIZR','SIVFDJRBFAVOPY','EFKBLIU','WEKVXIWONZQBQJGIAN','QTTWWVZALMOCIY','VRANXGABHQKFQ','KKTA','LOMGOQKUSK','KCXCH','IAKHQMFDP','FHIVJHZJRFMBHGQJ','ZKNJ','BGR','WWGKGNTFKG','DTVKZAMA','OOOXPAPQOWFJVSVV','DLXWYZJYHKLNQRHODVLF','EKV','VENEYJPJXBEDEFRVRQ','MHSXMA','PNGSMCENJF','KBBFGPHXYTBMENMQU','OSGSUKBHICIJAOQVF','OAQPENVJ','DFWDYEFZMD','MFNTJSQYK','BHIOQK','ECIFYYJTWVQNKY','KKFMTFFPKX','KNIPHCQTRIFWKQVHST','QSJNXGCJRZSTISIVNTAN','OPNAH','K','COLCJEA','VLIFMKSEYFSJSSIJELR','OTCPPCEGFMF','RTQWFVCHJVHKMMNVODQF','LJZQNXVWMBDPBLRANAH','ELHSEBJHCEYPTH','CIZWPEZSRZRCAJSJRNVS','YX','JEOJPVAWRZCENTGFKI','TGCZ','UINFPXKVYAUVEIQEVJDU','LBJNSEBDTDRN','PZRGVSPLWGUZZKG','UWILYJONFBSJJNS','GAHHQY','P','EGMSUUWGDVI','QQWXQVOPLAJLHKHOO','KFRXTPQO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JEOJPVAWRZCENTGFKI'))\r\n%%\r\nnamec={'CSKVFETS','LBYGZSQJRQQOK','YBCUNSJGVADXYVV','JKJTLPGXMJCW','X','VCDMDU','K','NMVCXLJVSDZX','HZPEQR','VUHKKTVMLEYYRFAXYRM','CEQTVGTAVR','DRWHHUGAFBRS','U','TKZKQXBGEGZITHG','VNSDLKJETHKDUUNVSMCF','N','TLPDQGGPYEBGTST','JDWFNEASRN','GZWBLS','BRPFMTELBWXKBSDBLQE','PLQDVQIYOOGSJCCHU','ZNY','RKUFRMQEHIMDQGKWM','CODFQCBSEVEVBQTNP','VBALOIRRWMWBOPAL','ECPPHOWLMLMEHPSI','WOL','VSHCNE','MWXUHAOHJZMFZQZW','JZZT','YWTTXUENEJZSJFNC','CSJ','XTPKGEQWSFVDDEBFS','GGHTAVOKBAEMPGKMWCWT','OKTJOM','TAKRHJVJCW','OMYDES','QECXLKFMXRZCZQDIFAB','WFFRKQFSUHOFLYKPPADQ','UDVEVWPNUNWWKTYY','SQZZIULDKGC','AMFFCSTYRREGHWHISPZF','QJTPNND','ZJYOVPXRNAPGAPQHKWXX','PIKMVOCQPSFMYSTS','DKMBCTJKAXZSQADZ','IIRKRCWGPLSD','VFVOICPKCJFNZGIMJQN','AMRWSCZGTYRZCTLMOMK','IMJOZCRJLJ','FSCXCZVNTKGIJGGNPUAE','RFTYBQEEBEXDVGQ','YNWGOMUNYUJJ','OFLBGTFCUBR','OQBRKADPXKFRIGJX','UQBJNPNOVVIJCB','TIUWNLTXURCFUXVVYE','QLXWZOWE','OFDGSZLOELBHINWFIOY','JYOBUWPSULYAGFVNCZGB','UPZRXVXKUXTHHM','VUPDBBZR','BMLYPBJKKYXDE','PNZKJSS','LLIKKRPDSGLRV','CYTINFVIZYRFMW','XWSJZIF','OQJXHCYWHT','HOERTQJBB','TCDLCIAQ','JCYEUKSQ','HRVAECIN','CGGVABCCCYKTMFWYQKLZ','EAWICWNB','LILXC','ZTYG','DXTJHSRLSJMUCZNSHM','SNCWCSUJQYAJFJMPQPY','SPKWORDMAFYXRZBLZLQ','IVXXA','E','TOHASOQMXLNEHQNDRTCZ','MOJDSIWHOVHCNJICCOBW','FJAYM','FQBOLLPTRSYWPDVPQV','ROWOXWA','JGGCMRON','XNVP','QGNPCCLYR','JJYKPWNKRPWOIFQFPC','AVNYDDWINQ','UJYKLNEYCNUUOSMGXGBX','XXH','ECAFLCIYVDSP','QWUWVHGAFZCZRHHBBOY','KCAYQOUNTDD','B'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'FSCXCZVNTKGIJGGNPUAE'))\r\n%%\r\nnamec={'FKIPG','FIEOUUQP','RN','MPPBIJRAXYE','CCVHLSNXIWIJBNV','JGGHIQWFKSAGPY','GBDYGYDJYFL','JVZ','IJPSUPQF','QDCUUIQONKOEZZTVFKJW','SHAOOFPBJ','VVKFJMPMZOBITLREWDUK','ERFTHS','IXBM','QOZQ','MMJCPWBZ','FRCCUBIFBBGANTRKZMSF','AGTHUZR','ADYQXRZUSSKYQEBOJKGP','FGLAPUWMPQ','ADPUNERYENYAPAJZQQD','TEI','MQ','CQASGO','YAEUN','UUUVHSHXVAMRANGMLOH','YOJIIJMUXCCFWX','KAYW','LW','RIULPYD','FKLNNZG','AHYVKGPCF','NDDRBZWLGMQUH','SIGRH','JRHFEJCYHGH','BYDIOZMXPMD','FNT','OYVDVAHHZOJBMPBTCO','JDFII','TFCRVXUEPKLPFYYCKEE','GWRLWRLWBFQLKBV','ISJDFYTZXKBQ','MIGDMEKZMV','GETOPJ','T','LIGBBAJUMKQWQM','MRQ','XMHTRRIMUQ','JTSBV','JNXOHBPGQXZQCFYHZ','DOL','D','KFN','GSCUSNZPYPLCRIQDUL','CMNQWSWBRCD','MYVIWUXI','LPEXAU','KOJPAX','OZNRUXDHQPPVLISOA','LCOURGNNV','A','JOMVNGMJRCRFIRNTLTJZ','EQPXQG','IMGVZ','YBDZQIEZNXHCDKCGZR','CLOOK','CYSAXVRBVVEHZCPR','SXH','ABJOITMK','GKVTTWKLLGSEUONCYBV','DWFLLRVVQL','HWNWYQDAXIHJCB','DPHFBLOOYAZKARPWDBR','TKVK','LBYSXXYMJXFZGK','JL','FAATKTSONFCGUOLIPFF','ACKDN','OD','HENGYHM','MHFCTBIBCQHUUCWXHD','LUHHZDFLCSLORQIGSRH','Z','TPNTVCTYOSXBOUNQ','Y','RKBYUKXCFVWMRL'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'VVKFJMPMZOBITLREWDUK'))\r\n%%\r\nnamec={'PNJLGCFVJGHGWO','UYIONSVIG','CL','HUESTKNQX','SALYWREELNSZBP','BNJDZJKHOUSQDFKXCKJ','TNBIT','EMFHXOJXUALHZI','YBTCFQQZ','EDFYSBGQGC','PZZPG','DPLIWQLTYGDXJAR','XQFVWHRH','EPBSQBHQPXERQ','MKL','TAFGSLFLICJXG','YNZCPIXB','ZE','PFXEDL','IJIEPJV','NOHRGSWBSDZATZXPEYE','UTORC','XVIWAUSOTTYXILP','KLMSHODTREWLEGMEAKQM','BMHRB','UGFMAYIKPGKKGOODGQ','SMNATWYMABFAXVAZHBGB','EPS','VFTCJCYYSSYPRORKID','JHBQIAXTCCVXHHVFR','ZZLQENONICOQDBEEBTX','NPNHOUUUIIZPTLUY','ZDJLXCPTDEMUJTEQ','YHQYYTNGWZAJMZH','WY','LTJPKLFOBARRYL','RVQKALVBY','DKTOPDDQ','AZMQGL','QCPSYFPYQDHGYXAEMG','HJ','YBOHRMKQUE','IQOHTONIIIEC','PJQZRCC','OEFIFNNE','JDHEBJKIKGGAZFFA','NHM','VSXQHZLFCPMWWZUYVPIB','HAOSNCEVJDGBSFNOVSLP','GFHEAVXFPT','YSWXTKZRYXQHLTPNQV','NNRKFIZKXOKYVDNYXID','XTQABKRPUW','IYZILFCRELKHZAZBLKR','LLKSWMIAD','KAZJAGOZGIZR','FHTUHMLKNV','ITAHVAFRTDBP','VCNJOSINAUVMBXZ','DETK','LHFAKGPZHUIIETIK','XBAQSPFVUY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'NOHRGSWBSDZATZXPEYE'))\r\n%%\r\nnamec={'SPTOMHCELYFKFSX','WINRFF','LTHAOJDIFHHEFCBPZD','RAAHGELRLLOI','PDRMKYDG','FHHWZSPSTXKR','NEBYKBDR','MVHGZ','UWNHIZZFDFQPDP','HQOKRJTOV','VS','J','TKYOPUXP','BEZJKFTUZDLGQBML','OSGYFMB','CYK','UDHMGNBAIMJ','RVCXB','RGNKBHEDHQG','XKCEUASFAMWNHPOH','NMEGU','JTIHPXRJWVM','UXTUFDZMKBMOYAM','WNAUDPIMVLMFXFQ','CTAH','CT','INJVBQXR','JRBIIEMGJW','MMEL','ANGNWTDYQTJDISMB','UXDLVHXRSS','SXOXQDTCTILOJWCL','AEIKGXTQEF','LUNOBPJCKTVNWANST','KEIVXZZUVXBDI','OEGDI','TVLQBVZMSWAJFPC','NKTGDWFEQZON','FBMAYLMQUSBW','PZIEBETGIRXZ','NKTPM','ILYTPLBDMPGTKPYMTNK','WZWGAYZC','EKLVVCOWGCFMGYRQNJM','IMWZBYZFG','RZMXJTPHRTXVJNZHSJD','EQWFKORZPK','LIMZG','OGJNP','I','ONHKJCTRSHXHQJOWX','MEUJMQQLV','BYXNMK','TAQPQRJKTWKZML','V','DMMDGTLE','REA','VRXWMNMOJQZJX','EHKSVVRZFEVGEXV','NZCZJDDED','IH','IJTEWCNJHJ','N','UPMHRIMYEQQRRZVLAE','F','FEKEQRQXHBJBSV','FJAA','NSURBUOO','SQVEDH','WGUCHJUXRAPJHGWRBKIP','DDCQXSU','AOJTYNTKWS','OGEPINA','IZTZQJ','AKSGBUDUO','KQBCPHX','UPWLLPTVEQNGETYOTB','VRCMMJATCBSL','VX','KGDSLBPWAJHLCIZUCH','DNG','AXBVUCA'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EKLVVCOWGCFMGYRQNJM'))\r\n%%\r\nnamec={'IGOYRFKIVTERT','DKOHDARM','TMIKMYTDSFH','CSGTIZWEFDBR','KADAEBAPFYIYGO','IQMGMBMQLTWUWC','RYRKYYPTUYFTI','QCZFOSRARULJLZEXMCW','IEJYJY','RKCMPQAZRSHUTKQPUGNV','NZEHCBZTDXKOXFXD','NPPALM','KZAOBCZ','GZR','BOZQSAAZPVZD','UNUUTLWODUMUIDS','JFSTFKOMXCBS','JXWNPDGVSZT','UMAWLBCOZUPOAIYXEQH','LFDKXVWELNQDK','PDCDJTPREPZ','IVGPDJUMGUE','XJK','LKEPMYBODR','MPPPZGHZSDMEHBQJBV','RPCVEXLWWPHHBYXWSUW','TPJEKMWTTYCYJG','BVPBOKODUYWCQPWBQ','FSZH','NCJWIZ','VCQGMOUIGWWHVPXE','L','JKHOMQMDNEFAK','GWKDCDMJQYN','FSMYMUWYPU','AOOYMCYLVNYWK','KKDOPSAWIV','NLXFXCY','VKFODHFF','AYXHMQMHKU','DKNUGCMEJL','QQFRLYDQQEJDVTKCMQ','YMJZP','DCFLDAWFITJERJEMQFI','SJDKAPWAEREJZ','UFAKJ','UFCVECPWEE','OHVLIZVXZ','R','ATUFSOTWJEP','JZCKJKHATGYHWY','ONJUBQJQZF','IGSE','NPUPRTJQHYKIQ','JORJFKJLQLVZELEXNUA','WTHARCXT','YADUX','BUTHBXDQXRIEAPC','AWW','QOGEM','C','J','LCFAVHFYMSYMK','GTWZZSHIQ','KDVUBLNOSKNP','ETPUXRV','MQYBPYJJEMRSFBTJD','RWVHLWYCNXGWJDJ','HGNQQSPJARNYEHCETYU','ANTOWTNRUWQSDF','SOPFTC','QJEMUUDZMIPB','CKIQNAB','K','ITAJGBFKW','NRIWYPM','ZUPWJOCSZKQDAIEKKIYW','GUZV','QQHBBQVPSCKKFVT','TVMTHCDKAJWSW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'UMAWLBCOZUPOAIYXEQH'))\r\n%%\r\nnamec={'FSZESYIDKESTRMQPSS','JLKMFOSQF','XSBMEJHOGEXIMA','AJTVMJGOW','MTFXUJVQEEIN','MNXEOMSSEOUKURY','AN','XZHMRQQGU','TRZKZBO','UKKU','THKLUBIIJRQZXENQYAST','CYVFVXRWFYDQ','NPWCNJ','EFAUAA','T','YOPBR','GLPWSLDTFMV','QPIICXOJWDKJPI','AXBDUFDCCHPRQL','GALFAFUOOERRGD','TZKUVBRQZMXKBNCINF','FKZTRF','NQLYCRQKEOWFDUC','AUJTLFQFT','QFCLOKNSBJCHVN','QDHZHFPSDCPWXVE','BSVCTXXGBXCAKU','JEMNZFC','CFJMEBL','UJSNCVNELBNFCUDODMGO','ISU','LXB','DUODTCGVHKSW','OUDTEGTWSBEMYPG','MBXGAOODYIZKO','JSNQPEIY','ZVBBZGZTMZZPMXXXA','YS','HEAVRWFKQWQLLRNANXGJ','RQMGGNETWSYCRTUKLCJ','BOEVUNAHWEGJKRBUEJVH','DRPGWQSPAWHMGTDZSNF','KBCTWJT','SRZRKLFZD','YPZXPODCDBANCDYREO','XXWCZZHNHNWXJHMXDO','EOCJPOLM','EXWVAFTSMY','F','KRTFX','BADJAHPDL','IVVLKBFMBOQVTBVUB','UDQTK','AJ','IIYAWVDYOIGM','V','XCWGXPBFKJQ','VQACRASJWBMQ','UPUWKP','YWPCPMMYDHH','BYUDKVPTHETUYFQQ','CSGAVUENWJMXMDIXCFTV','NNPEXJBWJOTEXLNMAG','EGJDMVLZGDQKZDSJY','WCBZDSVJTFBCCME','IJRJMXXJSVKNQUESSPXG','TFFVIKZJZAFBJUZKAI','FYDB','NRFTYRXHZZZQF','IYRKEAOAFTXMG','RSEEFDWXAULIPUKLUHR','EHDE','CIULRIHVFZVPD','KJANVABEAIWYIMFNE','SCIPMSAZVJ','EXSTWLXTF','YC','HGRIZZXHXEAKZBVYQT','BQRYGORWQPVWGIBBQ','LUXVPYULSREP','KDYSKHKQIDJEU','P','DGSUSJBJKIBQE','TUSPGYQCORQ','PEF','FYHFFNWCMPBCGIAA','CGOLOTDDPAAMZIJV','XNDRRSLMYLMQGHWM','HLKGGKGKFOUSMFXPWLZ','PMPN'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'THKLUBIIJRQZXENQYAST'))\r\n%%\r\nnamec={'ROVISHNKWIRVFYOZTG','PICZ','GF','XEGMHFSRFTX','SOFGDDVBTDOWBLEQQBWU','IROHUFREDPGGBRXUFZO','SZSFPXMWFRJCMZ','TX','VVW','TTVZCJYTTNPQAUI','AMJBBCWQJOUUD','PMCQ','PCJOYAWISWUQOW','GANMU','HXKE','MUMUOVEJVABVLQEACK','IWL','EOTQBINUTEP','ZHARSQNTKXDIBTVWZK','MDMDQZOGNYGGDRW','GDJJDCPXUKZYOJHXX','OOTB','ZEAJ','EOHIRXCJZUZCSX','RJBPDMQQHNII','GNCGVLZ','OEBDO','HYXEZJHRQGAQOPT','VK','IQIMSELNLZUFL','AMYCA','DSDXJQZMYMUWZJFGLIM','UYTW','LLQA','BJPVBBE','X','BUIANDSLTA','CLHKD','MNMBOCAGRVKUIKSV','CYCDDL','VUWTHN','GQJGTCSWRM','MKGKFJNUFMEZPYKE','SFO','SQFKFPXM','ZSATEUQQQDNCTPLDCJ','VSSBPZQOLHNLSR','EKBES','ZDVCMEXAO','PKDEYGDASVRMRFOQG','EGGEJWXNOWJY','BWTNFXXDJ','CO','IKRABUNQM','ANSJAKLQZJURSVU','VJCIJ','UOKNFBZIR','EYNHPDXHCUIUQ','UVLCBHWEYNM','ZI','TVZWTEEJVGJ','CLNXKFUODS','VZCJQAZHFVIUAJ','IWSKUIYLLMOCA','FBRSOXGLRGIT','IDSSXEFAQLC','FJWSCYRVD','BJUJXUIJQMO','URLWCIH','BOTVBWWLYUO','FALLJCUWNWWUFWWLKDJY','IQLCJIQINJLZSFQ','OMUTEEBHCBD','JWOM','WB','EXRCBRWAYEMNJQGIH','JLESZSASLVTJ','PYARZJJRDOA','PIHXQIYTME','XYSFFAUVWAICBZHRG'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EXRCBRWAYEMNJQGIH'))\r\n%%\r\nnamec={'MCQZORMCFCE','YZJFNXKRLAFWI','VSTPICWP','JNOAAMOXWBMYCECBRUVY','KNRBWAKNG','NSRCKZGETDUM','DHBGDGXIMOAP','GSDRFXLH','SMVCUZNPCPVGNHVLDVB','OHLLSTWXVLZ','HBTJICHVJFVAJX','YTPXEQP','BGGKNUVOUXWLZ','QQLFZFNLQJ','DRYTBDIDQYXKJPVEAMHF','MSLVRMAMA','CTSFTN','JHTIO','N','CZJ','ZOKFTLCDWW','BDPHMOGBPUEOP','DAAYT','YNJJJXDDTKBZJDKV','AGIWRLWRFLHCFMDGWKZQ','RQMTUDTXTSKW','UTNTWKBZRXOTK','KACSGHKKTGDIQ','XKZMXOQONBCENEPW','VWXLZ','LMYEOLJISFETJKDXX','TIGVVDPY','DCTCRBDRT','VPWEIZBCRBXXPHABRZVT','YGITXGMUIPGVJYOZ','CVZPJREYDD','WSVNZZKPDXKUY','TNZKBKT','HFNKHUKPPMXKEQMYCIN','KXUEBIDGNNFLD','NTCSEM','MZI','ZWXYR','YNHDQNIVKTQFZHNBL','NGFCTZNO','TJJSERXMIDYRALO','YQLNVRSTLA','NWZZXFFTW','CXYSKZQQPC','YHIFKIFJWUFJFCOZQN','JAHLRDNWXD','WLGCULEEXJFDTYTZNZM','MKW','PHASPWVV','LZVHSAMJZCDOTIFOUI','WWRHSRHCJ','T','PKU','CYBEHBJ','OJBG','LGXXAXYVFHHQC','OVKHZJIFXOOQ','ICMYMHPROGQD','SQKSFCVMJHDRFWL','GNGKTXFEDNYNCW','WM','NYOMUCJMNDBTWDOO','KRKFXMTEBJJZYNPSX'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'DRYTBDIDQYXKJPVEAMHF'))\r\n%%\r\nnamec={'ISLN','SRIFXUBZGWBYHFRIN','SYXUWQKTDINJFGVZRXXB','RBWEBFPTVICNRWPSY','BZZQXYJJZ','UJXWGBDBFCKUSJIMBQ','P','ZLKBGXVPJF','KJLDG','OYXOAMBPYMLZSIZ','OJAPNDNTRCNCLQSIQQU','XGABKPCNQ','FXEJGXSIGVRRRQZHSOSG','WJRRQDKM','JFORL','QUZFUBIF','PMJOXFRZFP','WSHBJEABJCR','NYJWX','LMQIDEZJCJYVIZ','FNAGWWJCWSF','ESQHTLNK','QLHHUYZVXWNYQC','HQAIOUAANFMUEYGZLGJE','O','GQIYYQZWMZTPTPIZNMPR','WFJUOFKEIPECBUTXCPE','WPGWKTYKZ','WJBCAF','HKMIWCBZJPX','NQXCMLXHNSCFU','HUBJTDVZPMQZUK','DWGIDVHQ','CVVUDUWPNLDJ','HFRJNS','NOUNAVHOFEEAREPCRF','VOYSBMTGXMQZACFFKP','MSPJXWH','XZAONDLMLDLAJIULG','RKQYTBQSAPERICXHP','STAIWDI','EUECSNMEHYYM','BIPJKIIRSGTWWRTCLYK','WBMKUAQS','FODMQMBPJZSDFPZXQ','NMJQDJCV','IXBOFYVOTJSZQFSZNB','BFWRJXMWXUMMKF','QKHIZJFNKCVPZJ','TCEIQUJWEOJPVR','KHX','JRRNY','GFWAJXINHAEPHLYFI','ECN','YAYKWPLOZE','QJWQ','XGWAEAFIYCOOSGAVDX','GHBCWJDPDDTJDLKEH','B','ETUFC','UJNTCP','MTI','WTX','XDRCRRDXOPFTRNBUVE','DPV','OWWX','KEUTWY','GJKRXKXLAGPZJAQ','WWIEKSIAAWYUDAN','PZCVKWDFCU','QSITT','DNQJZPBJRIT','IN','FBEZPMPJQPQK','FMXEFYVNUCESKJ','HKQZUKWTFBPCT'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SYXUWQKTDINJFGVZRXXB'))\r\n%%\r\nnamec={'NENLZQOIKIIPVDBO','PHKZPOEAQQVMCC','LAZADBYKWMHVGXONHKOQ','DHAGCRYRMYIHZCSSW','RFT','ZGFFOYIVQGPIXJZD','VPBUHKZSXFRVCWSALF','NOGAMCBPYQJGPTBDHQAY','C','VJISIBO','XSTTTENFNLMZEHCV','TNCCXGDLGAEVZJOJKO','QJLAQFNQYSWVDUYGT','CCDDRAC','PVFDWQDAOR','IFWSNMCUEXVHCVCWP','BGFUOILE','AE','UZXQKGPNRFSYCT','AQPUWXLETYHUWB','R','SODDLNI','HCLXDIXUXEQMMMKEFMON','E','EHARHWQJ','JMWJ','MCYUHPCTZ','YAFHAJEINPSAYVBOLTSN','JMDBQCRQHQIIUF','RSXKKTEBZ','UNUDWD','CUGSU','UFB','OMWLOYAKZR','PBILPD','DVYRGUFRZBLSMREFAW','HPPSBS','CGUXLV','UKXUEKZBAZPICBXN','MUUOD','MVRDGH','RIHZLY','LLLTGMNTRBTXODFHM','OGWBDX','HEIKNBVL','X','DNGCIMBHQIVHO','FPJUEQZFEKLNIE','EJESIZY','IXONWWTAG','DRHJZDPMLTWMTR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'LAZADBYKWMHVGXONHKOQ'))\r\n%%\r\nnamec={'E','VADUTZCEK','QTZWFSQEKKR','XDOCFRCBNYJGO','REPMDAJN','NXLXZEJXUPKOICUECCR','GYXBQDOZIH','XYKUEZCLGJTIPUJUE','NCIMJMDCGFOCBRN','SYJBZKPWLP','JRGWHPECSCACFBLKW','FVIIIJXBEG','GPGOVYRBSREXKPECPBXP','XPAQOYMMXS','VIMFYVGNIKKSCMZZKZU','ZCLDPFN','SOJXIXANXKMEUOQP','GSO','RQMXX','ULBWFKPFPIHMEVNG','BZHPJQYFJUQWCROVENVD','BGRHEIFQJWCGU','GZVY','UN','QSGTN','NTLUQJUPOYAXT','MRVDDPPJBTMCVZO','PAD','PKCIZTXHHGCCVJLNCXC','ZYKJRBWPRCMLKBG','YFABOIFTKVQ','PREOSVDIIEGAUDNC','CUIEKVZHJMLPXH','MCNHTUTPTCJEMYHIEV','GBRQTQPYFSHCR','WGDEJNAARRAZNRFKC','SNWEHTW','VBDGH','CILYJLBQZWZWTFYZXAJ','DGLEBJEDMLNBJORMTRJF','ZFNOFDSLHWMQSDU','OKGQTNDILIVR','ZEABTHADVMUKH','DWM','IXWDXEDURNPMRPFGMCFM','TQRVXL','HXZHJKDCGGPXTAH','DFLFLPCWXUNIBQRQPS','SUCZRGT','NSLXWGZOHTAJSQSE','GXMZQNFFLYIWPX','WKMVSBVLPHXNABSRX','PVJVSYOQQYAMVN','YNICVYRXMFCF','RSZJFNPOV','MVWFQMKQOAI','RXFOZDMNVBXO','LGKPTZDYLQWXFUVTIYY','HPOW','XPDXQDBESSMPBDJ','VWFGGTDMSQQDZOWITP','RPSXMTNZDK','CMHIKDEYXMNEDE','SLBEPVRCQZSO','AVSXNZSGBKDVGQCRJGY','XJU','IHJTZ','EIQOOIHRLXTBDHTVWQAE','T','NJWFFXVUQCSCN','MKQZCCRGYGLW','QXSVLNTKEIVMAS','LEDNUMX','XIWJBKXWND'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'BZHPJQYFJUQWCROVENVD'))\r\n%%\r\nnamec={'MBU','PKVORAQRK','QPVRFOM','OHYGVGHL','PVVAVSXP','AGRSDGYGGJMFDSKSA','ZOQOUPCGXVGAQDHKYFID','OHDJIDKZRJDYWKDREZKN','RXWWCSBIZ','LV','GIQPLKWTRIQMSKFWZ','YNMCAFJMYSJABNUBGGNY','QVULCO','HJIZGEKUOAVOAWTNU','LEORUFHX','N','HOJYNFXRNYIT','BIPGVNRZHYZAQJX','PCJIWQNIYYCRYKXP','LCMJ','ZBPYALSCCRKQZPYUBSH','BLNEFR','HQUIXQZPUFROPT','KQAAXRXWTXK','ASFBD','SS','XGRI','JTOZLLOL','BOXPIZAINJQKTONDB','MDCUGIEJFGLVNL','NTWKVIV','P','UFXXBOBSJQH','HU','PBH','OITZFICBDOZEQGJZR','QPJBLCBJRJVEOVG','UIH','ZMZLKGNXZVAEPLGQ','XZTB','GANVRWYT','XZQRMIRQXVXJ','IWBQZBMJUZSNTIQNZ','WIC','YR','JSK','O','IEQTA','PTPEXJWZBAU','RHRG','OGG','WWM','YTRBYGYZVLTVBOABBTV','GYAIWV','IKJCDOX','DHIRHBKS','COUAAKAIGPVOXYKZUNU','FQFXUVC','VMFAKUVYGHFXKN','IDQGXYDWNEESGJJKP','UX','ZWMSMWYW','PMJBXUXTAVJCGLWZVSDB','RZ','K','HASIYHX','ANOVP','CSIGKZDMSMKOGJ','QRJXLP'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'PMJBXUXTAVJCGLWZVSDB'))\r\n%%\r\nnamec={'NFPFLMH','GAFVH','SHEZMDSY','JIJZGWWNDRDMYDR','QQMX','WMMQGRHFEFUTRAPFDTGO','PSDARUKGIRQPPUVFRC','KJTFKQDDFGECQ','EPXNZ','UKVDPBFLOT','EVMBIHENGAPWRMCZY','HYLDZIDPOHTFLM','TJSZJJSIIMZZPCVC','ZTOUSR','XXRCJEDFNWFOEAJMZWO','RDGNFRAQLVJ','ALLFOJKOQZHRH','KVYTQ','LWOGBFHZGSDZIF','OOKNBR','LAYXJREXHYHOFNVDYU','TUDFRHK','QSOJMHSDLKEQ','SHSMUQ','CMTKCFROCQCXUF','KH','XOZDSHULKCAJXTLSY','FIDNCZSFGGBVMTZAHLGB','IQATEQVBYYPS','CRBI','BPLUC','RJOPKRXSFXES','VECJRE','KENJGUMXPFCVFRGYLRXE','GQNDQHKZFWACPPHKH','H','BFIKUAPSNFBICRIEF','FPMMPOLVTYOYZQ','RXEFHBHDQPNZKGONNL','HCYWTBJMGLFTXNWRR','YRMWICLIANCOCDQPA','UTHNCEFVWHBJQ','BRBKTINOYU','QIGQJAMGVZRZWSYIZ','HTQTVZ','DCVL','T','WUXLTOMJAU','ZSGGRZRNIM','AXTNTJGS','RHLXTUPCTDU','JIFFRKNRFWOZEEORFV','DKOFVRRATZFQMHLYFZJ','XFL','FQCZHFFOCS','LTMQKYUNSRBTJQ','FDFAUNSAGUDRZCEPE','KAOLUPTGFQE','VUXIXPPGT','XNIRSGTMABTHD','DDTXHXCXAJTDOCCOMM','BXZ','YPN','KLFWT','MOWEPNYTTSN'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'DKOFVRRATZFQMHLYFZJ'))\r\n%%\r\nnamec={'DGQCQLGJ','IBNJOGJBGPPIJBQLK','GJXJFBIQKZILAJSF','AESPLZNFPV','YGNAI','IHYDPEYHDWSZSHL','MXGAONGONU','UGSZ','OZJGN','YMIQAY','SAQDN','JEYJCFHUTVPVU','GDWDYNKXS','DLAHOBKTAAJVHWDSCAG','EWBYPMZZXPRXASZTS','UBYMVWWU','SMHTGO','TJ','EZXTZDO','VBORBLBYKPOSDTZOR','ZKXZFIOALVYWJCMDNXSU','NBSPRJIEHJSUJP','QQOVT','BJQOKGDVSATEWK','RSMDGSYIUJIMGDK','ZVXTVM','HI','ZNEXBMBUCDHEKAAFRVCK','PXRPCEUHWKPJNKHDREBT','BQOWMIYWPSJXMNNLD','BONKTPSWDOYWKRJQCV','SFCOZDUJOXPDSTGL','UOA','PRAELEJ','YMXZTQXEITWI','ASSGLRORNYRWAIEVZXA','UAAMSIDSAVCP','WZZIPNBPDBMRF','IRJIWIZHIQ','GLNTZIG','YTBPNYRLDZUEZMX','HBDQ','CTENOFTKBHWQCPBDVBEQ','DJTTAVIFEPKQZBR','PZXNIGQLJKYZTF','JFJCZY','LMFUHVPAEIDUU','VW','RKGORHTQ','OMZPHYGOPN','LSPOAHWLQBVPPIW','RBKGXMLIRLGCSVRMC','NXLYDZLCQIMTNPT','DXHLFTUSVQXHWXBJEUGG','GSOLEEMHTARPUU','EVTNRJMPPPNZAZOTROD','ZYHWOMFE','WFNGMJBXWAKJOIEDZC','GGR','Y','HPAUOFVMOZGQEMHWLRPF','DHBEORFBKKFGZYYX','NBSLOZZRYECVU','VCFACXJEHVXXPHHI','KWMFJCEUWBLFDQGCKD','DGNNMDVNODLPYNL','NSCIEILOIGJDGJHB','GH','BSWXELUJ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'ZKXZFIOALVYWJCMDNXSU'))\r\n%%\r\nnamec={'FPMUJIS','HTMLYGHYLNM','AGBTPKMRJ','SSWGUVSDZMBCNLL','DRPGG','XTEZNPFNRTBMOONIMM','QXTCFLIXRRIWDEA','MSMOASUGYSLK','BAFDNNUXVTHRPG','QSCURWGROJRCTOAWTN','MQTOBZ','JOVI','DSBQKFOTVDJIWXQDHRB','FONRHGIY','FMQTCJXWSUXCFJGFT','GQCMFHVN','VWDAHFTQELVINRY','ZSXBRGGBQPAI','FACVSATHNHXZY','KRUJPOGMAOEIGC','HUAUVGUDNZCUBXOVCFA','FOAGVCEUXQFKWZN','MPZDESSR','JPMFMGKKIPA','EIOA','UGOBBKLLTBVNSJ','QTEZESAEJHECT','AQHX','JEVMRDXJI','HTDQHKHXDXWDC','DXMHCHAFKHGZFF','IVCICJXFDPXGJQB','VBBSD','RCCEAHTANIBXXG','JQSIKFVLC','MUPIJKDJRO','I','KJFEHXFBPLU','OOBTEQZHVFQ','HZRKWOHLRJQMJXQQFP','MGBUE','HNTGZWFGJOYRTDPIOYRW','CDBPFXKKTQ','DODMJB','RUUDHNCJJKFHSIJ','FMKIQBPKVVULLXSYS','PWZUVYKBYT','AXAAJXQTHQW','BCFTWBGTJNUVHBLRDANP','M','CXYFOTWLRLUGQC','QIPNMPJJGOQQJKUDHL','SEMFHZMYJKPSRWDIBBOJ','LSTYNTFXHB','FJWJDMSNAUZNKWOK','IYFJHGCQLT','WYAMQDEOIWZBUB','JTTGQNLSOKVGVT','KOJY','BLXNETEFIXMKZ','NZGEYKPUIHNBKPPST'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'BCFTWBGTJNUVHBLRDANP'))\r\n%%\r\nnamec={'OGLCMJBGUVZRYIQ','IAMGPYOLQRXBPWETMFUS','LFEFOVWUSDWNRZHN','JUFJK','VUCXCORYGMQJV','WMJZYKBSPZ','JQIPDYEJGULDLWRQS','NIPIYZGNRUVPHQH','C','MB','PHNNR','REMZRZEHIU','PGRAJVBZXFCGPVZCRWGQ','XDOXLEWSCUCVLRKXKPIA','DZRBFRJLKM','YXJGVDCGEPIUDRMMUJ','XPFKQQMUX','NYETXVLWZ','AHVRMDILF','EUNGVKSGIYWEMDUDOMV','MXAKTAWYASGFR','SOYII','VLOQS','UBGGXIZP','TPLZMVARFYPOY','FQN','NOUT','FHUMXNJNEJW','ZIPLCMQSSK','BQMCBF','NXLGMDKNTAFLJ','ITAQMINQG','SDAXMOC','RMANBAJMHICQTYYCC','SAXDYOXOPFOVHATLAT','IICKXBVXZTSLZRJX','PBHAWOQKGFHGG','IICOLCA','LJWNYXM','HBHVKJU','QNWWNNTS','VSXYT','FALWHF','UP','CWRGCUHRZFMK','FFMM','REIBDNXXQUDRSFF','N','KIMMFRQROZNWQ','MJZHXG','LSEDGGWOS','LUUMQ','FTXJ','SK','ORFNYJYWPQVKQDBL','YIYJJPAZOPEUZGA','HFZSILOBJRFZVEFXGQIV','U','PD','QLCOG'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IAMGPYOLQRXBPWETMFUS'))\r\n%%\r\nnamec={'DAB','EIXCAFT','TOCEGNSLVURCYGXYH','VHWLWNNWLSLJ','SLDYYVHDOBBJHQZGKQ','CTPCUS','XTLDBORFZZICB','KY','HAOTVBCDRVP','W','SK','GAPVLDXBFIUTFBKEDMUE','KSGVU','TJOTZA','MXSRCIGHK','DFNCZJJHSKYHUAPUSFCM','UOYNI','LC','ULQKSEVEMLFASZTPX','RGMWDMYOOMFPGZLBITDK','WDGKCC','GRLSDSDHX','AXAWWINMLYJE','HGACOLRR','FMVUD','NWEEXSBYIFSJ','PJ','HDFGOWPULKAPXWLHAYBQ','GELTA','RORCEHVHKVWDFE','FJGMDMQVDSBISR','FTNKXXUSVYDSMMY','ICBWKYWUKPZVFAY','PJYAKSXMEJUCEL','VKMJ','M','TGF','WBIYWSRXTQZXUVLL','VPMMEJQOZLS','FLKPDEIUTD','BONRSRVZURJJF','UXAKLFHECVSZ','XMPLMGIW','SJIMJEJMH','ROXFKZUMYOZCRNGPVX','RCSAEOBQWZGVBJIUUGFH','OUPWMFPVX','B','GQQOIG','OTCXWPJVMJ','VGTDMRFGKUESEULXWMHD','QOTNGYBIUKFTVR','JPEGLYJIAPXNFJ','ZOVITVARNFD','UHU','BVTJ','TR','YWNOR','CIWVZWRFWI','EP','TIPARSTWGTMGQ','HFBNIKWGVTVPIVXJ','LUSQXXOCI','HMAMMWEENPRV','IOZJZHGVSOHLBLM','KYBWVGCSLSFCEGQVHEU','ZITYLR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'RCSAEOBQWZGVBJIUUGFH'))\r\n%%\r\nnamec={'TTXYV','FH','ZTCNWGXIBALWVRJEBQ','OKSHHRPY','JHVFGPYOQQEISOFLSZZG','PRWOSAGQGVKMT','DYYOWEDKYQCWBLOIA','OIMSYDORNPBGUQL','YFMRJZBDJJQ','TCYTFJIVMUYIFDDREWE','SGOEEGPEAXBGFIEA','BUAXXDKUSG','GMCKRI','FEQUFEDFWDOQXOJIJ','RQ','AKFR','OZFSDRQHFTEOSGYPEUX','GFQCOQIJNTMAFM','QQZWXV','IMJECDKAAPIYAQ','BWOV','STGTPACIOIFRLPJDWSOE','QE','WREKGB','NUOFONFNKHRRRUCFSQJ','YF','QXWSXRE','BBTGHKTJRGEVBHDL','ICBWV','HATF','VQUSOZSKOJEN','HQDPQFJASYSNELVKQRIX','WAHHOCW','XWK','VUXSCTJM','SDMLYIZOIXNHHVHPFJC','ZGBHPGEBZIFLQASQPBX','JOICR','VQLTK','IHXBYBGJQ','GRCVQSIN','CWNP','YEYXZ','UYQXYILKM','TXTCVYYBKMG','GZQQXYHISQAVSEV','KRMJLFIKDEIDQOTKWT','ALMSQZFFO','JYWX','YDZZLBSWPMPLQEMWYJGR','WGKOCBFSNEOO','AOSH','EDOIZI','YSVQYXXXZQLBEYDBMJX','ANXECVMPP','YJRZWZPPEYQIDB','WBBQUKT','WDZUFNAYE','FJSV','VWOOQHWNCYQYVTLDYQ','QOHSNMTXHGKNMU','CSSWB','ZFCMITSSCASZRYHAG','MDTXBI','QJLOWPODZEVYVEQKVKRN','ERLYKNCWD','CKDKQGMVLT'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'HQDPQFJASYSNELVKQRIX'))\r\n%%\r\nnamec={'PGOBRMNZXGEFGZTNN','SWP','HDHNVNTTTJXCERAAFGBR','OBW','QVFMSDDRXWIEDRGNH','OMEFFWRLXJRCWOOMD','HMZUDITBNSTBEYSLKLMT','ETIH','PTYHBXCBFZPXYEQUVPIY','MHGZDKPEJGTUAWPU','MPIG','F','WBUQNTXAPDHLN','AZFTRNBLZRLBTQ','LEPERCJ','RKFUJQZPJ','UUAZVLVIPOXA','IFHCPTRDBTTL','CYKCTCGKKNZ','G','BRZTFXAWYLHNWHIABC','AFMRFLHODYSQOMNRMDQU','SKRDD','UAD','KYRFULXATNJNWVIJDM','GDGJGHXJDG','PRZPQUIVNVAO','EDAHBBOWBNPCCLF','FMWRIKZAPI','V','EYRERTKJUXZWZTED','XZUCEWUHUXWO','CA','DMVJTHFWA','K','XGFNCELUZMBAB','AENTWO','TXKDLZBIADFDPAAXAUT','MSSZHKJQJUBAW','EREJWJNHJNZGROCRQ','TRJVHKVWGRBZ','LRX','YZVUFAEVGFYQJPP','HSIJNWMBQG','LIBDAVVDMYUDOXTNLO','URGYFJWFKRGHITC','CQWWGPZMSXSMFHADB','MPCOYINCUHUOZHGRFF','BJU','ZVRQOFIEAJRYYPNTO','HT','BMROUHB','DSXYRCVVLIHK','OPGUN','FGOXUAVIZBTZH','U','BBAEQHLWAG','GVQD','DIXX','KBHAWAYNXABNCKTIGR','WMENHMGBKR','JJIKDNDXFDZSWDF','STYWCCEBZGK','QT','PYVAYZSIOR','DWCVLFFVKGQQQ','CIUFCLFC','XUGSDVUQYJWVWCIKGF','FZBIHCWWCVVUQEDD','EZLTJFIDEEI','IVK','LYUYPCLLFGBKBFHMGE','OALIWBIFUTWBFE','NHYESO','XNBSFGRFRR','SSYIHIBENSRMRMQFWXZP','OQBUFRJ','DRWM'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'KYRFULXATNJNWVIJDM'))\r\n%%\r\nnamec={'SKHQPUKYYWHWEZCMJIH','ZJKCBUJTATQISUF','EML','QUUAUOHQJAHWBWMOBJO','VTYXGJVJTD','TUSLTKNHZZNSHSQBGJ','MKRBXOLNKUYWIFLLKSBQ','UXERKIPJZQYCTHM','XE','V','NBRLSYAMVBVQRYWLGW','HPTJGSOAFZPOPPTG','CCYHALBWOOWKIX','DKUSRZDIA','KYBCZ','LYBKX','UYVSJMVTYBVRLV','ATIZAYSLSLXEYM','ZCWTXOHTXEQECA','DTJULIOOLISFMBEZSSKC','ARWIOYIXTTZBXVJHM','HKTAOTRC','ZGRGUEHGXSBZLOTLBSLI','RTFLSDAGXHPWTDFRWVK','K','LBOG','BR','NGMNMUUKJLFOUCLEINSM','LKX','CDGQIEQBG','GMKAKVFL','PXJLLT','BNMUVYMZDNXATKMAYJLV','WUIDC','PWQFFOWR','ZA','RLOUPPO','SSPTB','ODCL','QQVEIAFZWVMEYLFIGXQ','QRXXUSBEQRSUZKRMDBY','TKTQTRZUZMFSZXHUXNAG','K','MNYMPJPDXXISND','KO','EVOYOQUTGBCWOAJVD','PIDBDEMRWIA','YHZKOGZHISHPSIGVA','KAZDDVPNOXFM','MITKWAPLDKRXVSAQCIIX','UDJWLVKJ','YMKUDMYGPQSBSS','SMUJ','HDUCMDBH','SKQREOFLWQNLEV','SAPJIHMUJQQCPPFZNNW','KEMJPXGBRHJSHQXTRJFL','VIMJWRXDTPQWJCGLR','CQGLORUCKTVNILVYBF','VTYJGNIWFMPCZLXV','GPRJKLPCLZVULUZX','XIKTOZCVCVHLAJW','GQCARMRCQKBLPMWA','ZVBQUFITYGGNAAVKUAMG','BIN','MGRLXAFBVKJMZSIKZI','VBKDJUBHNWAS','NUZZTUGJVQVKYM'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CQGLORUCKTVNILVYBF'))\r\n%%\r\nnamec={'KRMMAQO','ZYQ','Y','JVBKJWEEIV','WPA','ZFGRNMWIHAABJ','OADLKMZGAV','NZVZWQW','DFCROJROCQJTMXHEPCP','UKWDMXAPLOQ','VLRMNKYEZXAKNDJDVAS','ZANHQCQOPBOBHQZLLKLO','OXNKHNJUBURGYP','ZVCANF','XJ','IXLVZSEP','FGICSRYYLBLOHXOUS','IFNXIETSAEZCZWME','GQJJHYQAISZYIXYEE','AARZ','JHVSGPGNYHWWCSSN','PJ','MJENAEESKEIZCVTJF','AIOCDJJMFNVBMSO','OLXYHBLJXXLTLDJZ','EEHQKUDZ','KAXVPRUJVY','KOZVNWI','MYEOHESCNYHLJQBSAM','DAQKJKIOCCJGJDLK','H','DRZACTYP','PQBXFPZHGFPA','OTQFQTOFPO','FZXMQIRBZZXYBBQKHOVY','IFFUCESAOGVY','RLMEMFHF','VRNEJHIFTMDKGD','JCFEDDHIIZ','RIXQXPNUFZQHXTCKVI','MDJLLSJCNTOVIWG','FUXFUQ','JLATDEWMQZAZTOQIU','IMGYRDGKASTQAETTHYDM','UMJSFJIFSUL','AGCCG','VW','VACYFIZMP','BVGBQOHMGNOILADIV','IY','CVRUJAFF','LQWTWBEIHHFHCN','Y','OD'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'RIXQXPNUFZQHXTCKVI'))\r\n%%\r\nnamec={'BNQDWNHIZMZIYPJDXE','ZOUOKBHYDE','DZDXCESGTXGU','CNPVALPBNO','J','KHAFDXAHDGWVEECG','RSJBZKGBLGKIQKIONXO','M','LEWPVZQLG','MBFTDI','FIDPIR','BXKUGBCNI','EEIPKZTDXIXZE','VTK','KECUYATRYYZQRFBMQFF','ZMXDTZEVLPUWCOQWGT','DNOUKLHFKLFZPQNLHEJS','LOFTEQNLJQS','TATOHFSMCTXOSEP','ZMLLDLCIOLZDZO','HUYESE','MPCDGQSVDWDOSGQUTNPH','COKSSOTC','VUYTMLCGIH','RDQGJCNGTIHAVTA','LM','ALUDNJ','NQFALWUQETMQ','LQDFSQIB','BMFR','WWDXEZOQLKFQZMV','KJIKCYLOAXOQB','CTHLWRQAOLUS','MNBHMFGMUMCGLFP','IYZWIMPQRLSBWTJRM','RKYPSYJFIJEULGHORP','JGPRZUE','HNBCVUSAZC','IWYOIEQQXRWI','JDFZFLCIJYSRFKEMJ','QRJ','USNVNLTIIWAQFJKB','VLEBPQDTDUSERAWWOZ','ERZEDX','FQEJEZ','YUFEZXEJHKHDFH','XDZIAXZFTOGJL','CFGIJBXFCAQCDV','C','PXQUQLZRXQYDWYEPR','KJKMFXELPRBAE','ST'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'VLEBPQDTDUSERAWWOZ'))\r\n%%\r\nnamec={'WVNPIGSHWNWEYZXVGD','UMGSKUBDCBPB','UMNZDCMZFVJDMV','W','U','KOOAIPPBAGWE','SIFAGBRDPHSJ','IVWKHKFOSGHQ','LTJLYBSSSVDPUWDVZDNR','KQYI','EOAUFDJGPDHZNI','DAUZBZFOGVAOOEUGQ','KZYRVCMEUUNPLNNYJOT','UZNBE','OCCMVSMMDJ','YWJFF','GLM','GC','AGDOIINNERJIZCS','YTVWSC','AHPAFSGFKOKXDPKE','RRIDQBXZCWCYUX','WFHCU','F','UOQWACOSPL','JDRWAT','OSVWNDCLALXOKVENJ','UUKW','SHUY','JHWDU','DXTKXVJOOQVEGBWVG','DFPIHXSJRV','XRUYYIIKNQXBA','IAKFHSMWGEKHVYK','R','DMNLUXLZCE','CKYUCCAHYLGCVIPISM','VZTC','V','JPBGCNJEGIUFTRDNIEJ','INTAI','YVPIHIHBV','FTYRQFMSQJGCRUVJA','TVDUULV','FSOVW','ZEGWUPW','LOEBGW','TZDKAXPMSKNGSM','AKPXNTPEQX','UPMFMQWSJPKAHNPUEXB','JAKUMRCRKNVXLFMOBC','IPWVL','KEUGMAZSUM','ASBULEZPSS','ZTDRKHGMDKJADZVRAAJ','XVQGIFQDY','MTS','WGLYHONYFBQCVYRLKQT','CPXOTZIU','OBENPRAUK','RFNAWDB','X','DACJTOFEPEFTJUJCBSLG','MFHHGIWHDWCMMQ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'KZYRVCMEUUNPLNNYJOT'))\r\n%%\r\nnamec={'EPLXOSPBMNFLSVDG','DTILFFBMPHCWF','LUK','NOBSCFX','EPDPPGUNHYLPCFULNBX','UGVQYO','LZKFJXFD','MYLRRLUCBSYOESDSV','VSZ','TKPWUXBUS','C','DUG','YQNEOEZGP','ZVJZLKE','WO','YOZHALURQOQMUB','HXROEIQAIOX','DMI','LIBXFTJTFNCXJSRSYNL','STUDO','PWNS','HLVJXEDNUFBHXM','HBSREYCMRIAKP','ADRBV','BDKDKZXILBIUFDXJ','XCOIGOLXHGMAC','DMKYS','BTB','QGSIUWSKDFJB','CDYFIEAOOZHMEDKWDCE','XOPEJV','KBHOZF','ALGLCCLGGGIUKCQ','WNABLFRW','BOHFVKPNFNU','ZWIDLE','QMXHBR','AKAPNCG','PLZFRUTRXBV','JRGWCGXXX','XDCPLHRRUCVPAAGLRVEA','OJQGLWVHXMD','OQOXGIGW','GMPTQHVAQAU','MQWFZORJAXYHCBV','HLG','WXWOXBOONMBUHHHI','BDGZTDIKBTZHENSJDO','QHUXOUYONUI','KSKPVDEQKJMXTN','ENFDUSQOYV','OVSQKUAAGDBKVX','RMUYDACJYXNBOXJR','GNE'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MQWFZORJAXYHCBV'))\r\n%%\r\nnamec={'MNXBEGBOOMKSS','AAZTPDMQEO','TUHWOCETRPPADJKVLKNG','JEHFKQYAQRG','N','TLCFCBFDHORCMRBV','ASYIFQQOXKIANN','GKABRTPVTGOKT','VFXWJ','HJGWWTQVVQW','FAETTKDWWSNDBLELSCC','AQMLDDCLSCJSHBXXLEV','FCLINFL','GP','WTUEHONR','DYPQIAUVGQJEPH','NRATMPUOKXBRU','MHJSZZUW','FSKSG','A','PPYEIGVJYDSMHVS','RIFD','WPHURHYCPKGNTNUW','LCRCTZIPWHHERMNTTYSC','XURWMZEPVSJJSYXP','BLUSPZELJQCTEQ','WLAJ','SKUEFNQJICEI','QRFYMQU','JFCHFLSXNANRFGEEHMG','MFTWKGYFBSEG','WVMOEVUWTQ','UDADALRK','NOHSWOJPOYLQRFFKBF','BRWEECKSUSNYIUVO','PLXCUMWAXCKL','HAARTVR','VRQNBTF','WRR','NJO','QJKWILPW','PJYHTCUMVKREZVJKW','JVKLYYTJHTHXUX','JZMWROBNJKB','ECCGFSWZPYCXRQRJSMV','D','HYAKZTGTNEZBU','MOGYEXDWFRYPBOOCYJN','USEPLXLFEHD','LBYKMNZCO','Q','EZNQBXXMQ','XO','WRXOQWATENOHYXVL','KT','DMRM','LUDNFTONTDKYJROC','RNXTYWHQYTWPO','MGRSTVXBIHLLGQFRLZB','L','EWULHSYNE','QMTQMIXGOUXRQYT','XMF','LPVQNZCCNSHCFTCY','IAZXRLSGWCWHX','PFSBLIFZTIU','QMSCWVUOWMCWJC','LRFRUSZNRDZLMIOWVM','KZCEBBILHZAFHSCYNG','YKTQYLUYWTRZPLPWZCOX','DTMTYSITUU','OXJOKUBFMYNLQLEZGP','ZKRZVHHK','BGBK','MBVJDMWHZDY','TXSVLOEKVOYO','ZZCSPJRDEVLMN','PVDJCJFNXTHXQCRQUC','VYDDKBOOKJLEWEPN','IRPTLCKJYXZSZLB','LSFPOTLVCP','BO','JZTLFYQRTPVRYOWBULN','FCEKHALVASPR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'TUHWOCETRPPADJKVLKNG'))\r\n%%\r\nnamec={'FLUEJJOMBLRDXEKQCCRU','LIYYDJ','OGTSXHBKSCDOEMQGVDC','SGWHEQZX','WUBXLLDNHSJT','PKDSEKIWIAMFRNY','GIW','XELJSPLL','BPHRHTSHY','DUXFYRXHOZRILQBS','WJHWDWVGEGLBABTS','SYLQBFT','HDFKJSBPPTQAUKGPEKE','LBJVIZZFNWB','BLQJPEPKXZIIWS','MWN','NEAINWUGPYOQM','G','HQCZZDRFPV','VNDZGDRZRBIXIYIZGA','PHKKYNLYUDODIR','GUICHJCXRXEYPCWAMJTZ','NHPLQGCWTKQ','TSDGDBDXDSXHMYJRBZH','LNGZYQMNWQSFVWI','RQPLKZDUFIXLOKF','WKUHTIYVUYNPHZ','UFZUFBPGKWRTUL','CAB','IJ','ZZQQALONCTOJUOOJE','DPDASWBKPMHTUBAEVK','SAKYBOLEFTAHWCZMU','UTTKNLHEVDO','NIWTMTZBTXIL','FJK','BAGMDT','KYPNASBVHNKYGJG','XEHDPYEHBRKUD','GSDRVABVNDP','ZZRKWNVKGW','RFWHDCDCMQCNHHQPSLCG','MU','STTUZEBEBPERPXEPBVW','YYRZHPQOBS','OOUYNTPVFUGGDZO','PMMAVJTPULZORKLP','GNJETMYHJ','MQNQRERGPCTSUZGAWRH','GG','PCSTZVH','H','GZPOECJ','IBWSJPQHVC','JNGEERMGZUNUFJJTJAUX','VIEVIXMGL','KURQLWQTHSKSKBUOU','NDXNTI','WBPHX','QEME','XXRQF','ARCFUSSRHARNWQKXXJ','ZMKVSZGFLLFEHJTRU','ZMHIEPKIU','GHRIVF','DHBID','HFKRRAMHMDWXWWFUMGZD','XGYYOU','OZSBMKFLSRGCCRHR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'GUICHJCXRXEYPCWAMJTZ'))\r\n%%\r\nnamec={'KMQK','NOAQIPAOFRHAMMR','YVCDENPUPB','VYENYLJYROVQEIPEM','NCGEJIBYURR','ALNNGYOAM','N','YNSSDMYHIDH','TUTLKDZIBAC','OWITMHACTQCUTJW','VLUOBXBJNDB','RPARMIEFDQVGDGDB','KPRDR','JMUYVFQAY','BE','JBNMLITMCTMZAEKU','X','YMUZDIVKR','XWNEAZIYQGLHH','TUWLIMXZHB','SKALCOICJQTZGZZYQ','KAFVJJOERHNSNIMTI','UZIXNKITGATLNNUYAH','UYGP','XPIGOTGDHMDQJQ','DVCKEHHQCF','JUGYEISLDRPGBI','AHR','ZUBVTBHVUWTS','SPQMHDL','FTGF','PTFFMZFEIERBXJDMSBA','I','DOJOUGCRHDAUBUB','N','HPTUDMUZNYZMJCGGL','BLCVBZECFRLMCACF','WSBMPQ','VOWCMYG','HHBLB','MKXFNVK','F','VKFSSVBDFEPCVJWKKBX','Z','FIAZFRPZE','VFROTTGAJ','X','ZNPZNKADTQ','J','UAL','RRXOTDRSERENERUXX','S','IBN','VFBROKKMYVA','JTXXXCTWZMOGQWHWMFQM','SQBKRULGFVWXHHTL','ZTOCLWJYANBT','DVIPYGNXJIVQ','CTGTIU','UJFVZGZRVISC','MRONZFKHKJSVJIW','RMZGHFTHXSJJATX','OERO','PDRQDKX','TFMRFR','MKZOUDFBJEGXMWBHCR','MC'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MKZOUDFBJEGXMWBHCR'))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":"2017-02-26T21:57:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-02-26T21:47:39.000Z","updated_at":"2026-01-30T12:45:57.000Z","published_at":"2017-02-26T21:53:21.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\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://code.google.com/codejam/contest/6304486/dashboard#s=p0\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam 2017 Kickstart Leader\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This is the first 61 small cases with no spaces in names.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGoogle Code Jam 2017 Qualifier\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe GJam story is to determine the rightful leader. The leader is the person whose name utilizes the most unique letters, spaces do not count, and if two or more people are tied then the leader is the one whom comes first alphabetically, with space preceding A, given a list of 100 or fewer names.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [names], a cell array of names using only A thru Z; max 100 names\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [Leader], a string of the name of the leader\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [names] [Leader]; {'ADAM' 'BOB' JOHNSON'} ['JOHNSON']\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor the example the first two have three and two unique letters while JOHNSON has five unique letters 'JOHNS'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Brute force processing appears to be the way. Methodical processing and function usage can minimize code size.\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://code.google.com/codejam/contest/6304486/scoreboard#vf=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam Kickstart solutions(C++,Python)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":44843,"title":"Nth Order Polynomial Regression","description":"Inputs: \r\n\r\n  -two vectors x and y (row or column) \r\n\r\n  -order of polynomial, p\r\n\r\nOutputs: \r\n\r\n  -vector of coefficients [b0 b1 b2 ... bn]\r\n\r\n  -R-squared value\r\n\r\n  -vector of residuals, e\r\n","description_html":"\u003cp\u003eInputs:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e-two vectors x and y (row or column) \r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e-order of polynomial, p\r\n\u003c/pre\u003e\u003cp\u003eOutputs:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e-vector of coefficients [b0 b1 b2 ... bn]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e-R-squared value\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e-vector of residuals, e\r\n\u003c/pre\u003e","function_template":"function [b,r2,e] = RegressionN(x,y,p)\r\n  b = x;\r\n  e = x;\r\n  r2 = x;\r\nend","test_suite":"%%\r\nx = 0:5;\r\ny = 2*x;\r\np = 1;\r\nb_correct = [0;2];\r\nr2_correct = 1;\r\ne_correct = [0,0,0,0,0,0]';\r\n[b,r2,e] = RegressionN(x,y,p)\r\nassert(nnz(abs(b-b_correct)\u003c1e-12)==p+1)\r\nassert(abs(r2-r2_correct)\u003c1e-12)\r\nassert(nnz(abs(e-e_correct)\u003c1e-12)==length(x))\r\n\r\n%%\r\nx = linspace(2,5,12);\r\ny = exp(x)';\r\np = 3;\r\nb_correct = [-110.9230,126.8980,-46.7825,6.3467]';\r\nr2_correct = 0.9997;\r\ne_correct = [0.8726,-0.6361,-0.8963,-0.4527,0.2214,0.7465,0.8663,0.4864,-0.2751,-1.0207,-0.9863,1.0742]';\r\n[b,r2,e] = RegressionN(x,y,p)\r\nassert(nnz(abs(b-b_correct)\u003c1e-4)==p+1)\r\nassert(abs(r2-r2_correct)\u003c1e-4)\r\nassert(nnz(abs(e-e_correct)\u003c1e-4)==length(x))\r\n\r\n%%\r\nx = linspace(5,7,8);\r\ny = [-0.9238   -1.5011   -0.2963   -0.2268   -0.9897   -0.0372    0.1509    1.5324];\r\np = 3;\r\nb_correct = [-196.1472 101.5622 -17.6070 1.0186]';\r\nr2_correct = 0.8063;\r\ne_correct = [0.2569 -0.6944 0.3739 0.4017 -0.4505 0.2224 -0.2019 0.0919]';\r\n[b,r2,e] = RegressionN(x,y,p)\r\nassert(nnz(abs(b-b_correct)\u003c1e-4)==p+1)\r\nassert(abs(r2-r2_correct)\u003c1e-4)\r\nassert(nnz(abs(e-e_correct)\u003c1e-4)==length(x))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":183622,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":12,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-30T14:42:51.000Z","updated_at":"2026-03-11T08:42:08.000Z","published_at":"2019-01-30T17:17:50.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs:\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[-two vectors x and y (row or column) \\n\\n-order of polynomial, p]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutputs:\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[-vector of coefficients [b0 b1 b2 ... bn]\\n\\n-R-squared value\\n\\n-vector of residuals, e]]\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\"}]}"},{"id":60242,"title":"CamelCase to snake_case convention","description":"The CamelCase naming convention capitalizes the first letter of each word. In snake_case convention, words are written in lowercase and separated by underscores. \r\nComplete the function to convert a function name from CamelCase ('MyFunctionName') to the snake_case format ('my_function_name').","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 93.0256px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 386.491px 46.5057px; transform-origin: 386.499px 46.5128px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42.017px; 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; perspective-origin: 363.494px 21.0085px; text-align: left; transform-origin: 363.501px 21.0085px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe CamelCase naming convention capitalizes the first letter of each word. In snake_case convention, words are written in lowercase and separated by underscores. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42.017px; 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; perspective-origin: 363.494px 21.0085px; text-align: left; transform-origin: 363.501px 21.0085px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eComplete the function to convert a function name from CamelCase ('MyFunctionName') to the snake_case format ('my_function_name').\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = from_camel_case(name)\r\n\r\nend","test_suite":"%% Test Case 1\r\nname = 'CamelCaseExample';\r\nexpected = 'camel_case_example';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 2\r\nname = 'AnotherExample';\r\nexpected = 'another_example';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 3\r\nname = 'TestCase';\r\nexpected = 'test_case';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 4\r\nname = 'LongerCamelCaseExample';\r\nexpected = 'longer_camel_case_example';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 5 (Random)\r\nRandom1 = char(randi([65, 90])); \r\nRandom1 = [Random1, char(randi([97, 122], 1, randi([4, 9])))];\r\nRandom2 = char(randi([65, 90])); \r\nRandom2 = [Random2, char(randi([97, 122], 1, randi([3, 9])))]; \r\nRandom3 = char(randi([65, 90])); % Random uppercase letter\r\nRandom3 = [Random3, char(randi([97, 122], 1, randi([5, 9])))]; \r\nname = [Random1, Random2, Random3]\r\nexpected = lower([Random1, '_', Random2, '_', Random3]);\r\nobtained = from_camel_case(name)\r\nassert(strcmp(expected, obtained));\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":208445,"edited_by":208445,"edited_at":"2024-05-08T16:38:51.000Z","deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2024-05-08T16:38:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2024-05-08T16:23:42.000Z","updated_at":"2026-04-20T03:05:27.000Z","published_at":"2024-05-08T16:38:52.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\u003eThe CamelCase naming convention capitalizes the first letter of each word. In snake_case convention, words are written in lowercase and separated by underscores. \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\u003eComplete the function to convert a function name from CamelCase ('MyFunctionName') to the snake_case format ('my_function_name').\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\"}]}"},{"id":263,"title":"Nonuniform quantizer as a piecewise constant function","description":"Implement a nonuniform quantizer as the following piecewise function:\r\n\r\ny = -3.5, x \u003c -3\r\n\r\ny = -1.5, -3 \u0026#8804; x \u003c -1\r\n\r\ny = -0.5, -1 \u0026#8804; x \u003c 0\r\n\r\ny = 0.5, 0 \u0026#8804; x \u003c 1\r\n\r\ny = 1.5, 1 \u0026#8804; x \u003c 3\r\n\r\ny = 3.5, 3 \u0026#8804; x\r\n\r\nYour function should act elementwise on array inputs.\r\n\r\nFor example:\r\n\r\n   nonuniformQuantizer([-4.0 0.0 2.0])\r\n\r\nreturns\r\n\r\n   [-3.5 0.5 1.5]","description_html":"\u003cp\u003eImplement a nonuniform quantizer as the following piecewise function:\u003c/p\u003e\u003cp\u003ey = -3.5, x \u0026lt; -3\u003c/p\u003e\u003cp\u003ey = -1.5, -3 \u0026#8804; x \u0026lt; -1\u003c/p\u003e\u003cp\u003ey = -0.5, -1 \u0026#8804; x \u0026lt; 0\u003c/p\u003e\u003cp\u003ey = 0.5, 0 \u0026#8804; x \u0026lt; 1\u003c/p\u003e\u003cp\u003ey = 1.5, 1 \u0026#8804; x \u0026lt; 3\u003c/p\u003e\u003cp\u003ey = 3.5, 3 \u0026#8804; x\u003c/p\u003e\u003cp\u003eYour function should act elementwise on array inputs.\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cpre\u003e   nonuniformQuantizer([-4.0 0.0 2.0])\u003c/pre\u003e\u003cp\u003ereturns\u003c/p\u003e\u003cpre\u003e   [-3.5 0.5 1.5]\u003c/pre\u003e","function_template":"function y = nonuniformQuantizer(x)\r\n  y = 1.3;\r\nend","test_suite":"%%\r\nassert(isequal(nonuniformQuantizer(-23), -3.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(0), 0.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(1.1), 1.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(2.9), 1.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(-Inf), -3.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(Inf), 3.5));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(y, nonuniformQuantizer(x)));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(y', nonuniformQuantizer(x')));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(reshape(y,3,6), ...\r\n    nonuniformQuantizer(reshape(x,3,6))));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(reshape(y,1,6,3), ...\r\n    nonuniformQuantizer(reshape(x,1,6,3))));","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":4303371,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2012-02-05T15:02:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-05T15:02:53.000Z","updated_at":"2026-04-20T14:17:41.000Z","published_at":"2012-02-05T15:07:06.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImplement a nonuniform quantizer as the following piecewise function:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = -3.5, x \u0026lt; -3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = -1.5, -3 ≤ x \u0026lt; -1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = -0.5, -1 ≤ x \u0026lt; 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = 0.5, 0 ≤ x \u0026lt; 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = 1.5, 1 ≤ x \u0026lt; 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = 3.5, 3 ≤ x\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour function should act elementwise on array inputs.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example:\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[   nonuniformQuantizer([-4.0 0.0 2.0])]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ereturns\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[   [-3.5 0.5 1.5]]]\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":{"errors":[],"problems":[{"id":45218,"title":"Find a common edge","description":"First input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct integers always sorted in ascending order, ie e1 \u003c e2 ). The goal of this function is to find and return the indices of the rows in the list which contain this particular edge. Output format can be either a column or a row vector.\r\nFor example if inputs are\r\nT = [1 2 3 ;\r\n     1 3 4 ;\r\n     1 4 2 ;\r\n     2 3 4]\r\nand\r\ne = [2 3]\r\nthe output is the vector\r\nrow_idx = [1 4]\r\nsince [2 3] is contained in rows number 1 and 4 of T. With the same input T, but with e = [2 4] this time, the output is the vector row_idx = [3 4], since [2 4] is contained in rows number 3 and 4 of T (Note that edge [b a] is the same as edge [a b] so must be the corresponding outputs). If the edge is not in the list, the function must of course return the empty set.\r\n\r\nSee also\r\nMesh generation\r\nMesh processing toolbox","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 500.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 250.3px; transform-origin: 408px 250.3px; 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; perspective-origin: 385px 31.5px; text-align: left; transform-origin: 385px 31.5px; white-space-collapse: preserve; 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; perspective-origin: 377.083px 8px; transform-origin: 377.083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFirst input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct integers always sorted in ascending order, ie\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; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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; perspective-origin: 23.5417px 8px; transform-origin: 23.5417px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003ee1 \u0026lt; e2\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; perspective-origin: 247.358px 8px; transform-origin: 247.358px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e ). The goal of this function is to find and return the indices of the rows in the list which contain this particular edge. Output format can be either a column or a row vector.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 77.0167px 8px; transform-origin: 77.0167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFor example if inputs are\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 81.7333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 405px 40.8667px; transform-origin: 405px 40.8667px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 46.2px 8.5px; tab-size: 4; transform-origin: 46.2px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eT = [1 2 3 ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 46.2px 8.5px; tab-size: 4; transform-origin: 46.2px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1 3 4 ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 46.2px 8.5px; tab-size: 4; transform-origin: 46.2px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     1 4 2 ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 405px 10.2167px; text-wrap-mode: nowrap; transform-origin: 405px 10.2167px; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 42.35px 8.5px; tab-size: 4; transform-origin: 42.35px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e     2 3 4]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 11.675px 8px; transform-origin: 11.675px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eand\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 405px 10.2167px; transform-origin: 405px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 34.65px 8.5px; tab-size: 4; transform-origin: 34.65px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ee = [2 3]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 70.7833px 8px; transform-origin: 70.7833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethe output is the vector\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4333px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 405px 10.2167px; transform-origin: 405px 10.2167px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; text-wrap-mode: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 57.75px 8.5px; tab-size: 4; transform-origin: 57.75px 8.5px; unicode-bidi: normal; white-space-collapse: preserve; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003erow_idx = [1 4]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 63px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 385px 31.5px; text-align: left; transform-origin: 385px 31.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 369.667px 8px; transform-origin: 369.667px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003esince [2 3] is contained in rows number 1 and 4 of T. With the same input T, but with e = [2 4] this time, the output is the vector row_idx = [3 4], since [2 4] is contained in rows number 3 and 4 of T (Note that\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; perspective-origin: 1.94167px 8px; transform-origin: 1.94167px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \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; perspective-origin: 117.825px 8px; transform-origin: 117.825px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eedge [b a] is the same as edge [a b]\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; perspective-origin: 1.725px 8px; transform-origin: 1.725px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e so must be the corresponding outputs). If the edge is not in the list, the function must of course return the empty set.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 8px; transform-origin: 0px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 28.3917px 8px; transform-origin: 28.3917px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eSee also\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/cody/groups/95796\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMesh generation\u003c/span\u003e\u003c/span\u003e\u003c/a\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003ca target='_blank' href = \"https://fr.mathworks.com/matlabcentral/fileexchange/77004-mesh-processing-toolbox?s_tid=srchtitle\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eMesh processing toolbox\u003c/span\u003e\u003c/span\u003e\u003c/a\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function row_idx = find_common_edge(T,e)\r\n  row_idx = e;\r\nend","test_suite":"%% Tetrahedron 1\r\nT = [1 2 3;...\r\n     1 3 4;...\r\n     1 4 2;...\r\n     2 3 4];\r\n\r\ne = [2 3];\r\nrow_idx = [1 4];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Tetrahedron 2\r\nT = [1 2 3;...\r\n     1 3 4;...\r\n     1 4 2;...\r\n     2 3 4];\r\n\r\ne = [2 4];\r\nrow_idx = [3 4];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Octahedron\r\nT = [1 2 3;...\r\n     1 3 4;...\r\n     1 4 5;...\r\n     1 5 2;...\r\n     6 3 2;...\r\n     6 4 3;...\r\n     6 5 4;...\r\n     6 2 5];\r\n\r\ne = [1 5];\r\nrow_idx = [3 4];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Triangulated cube\r\nT = [1 2 4;...\r\n    2 3 4;...\r\n    5 6 8;...\r\n    6 7 8;...\r\n    1 2 5;...\r\n    2 5 6;...\r\n    2 3 6;...\r\n    3 6 7;...\r\n    3 4 7;...\r\n    4 7 8;...\r\n    4 1 8;...\r\n    1 8 5];\r\n\r\ne = [6 7];\r\nrow_idx = [4 8];\r\n\r\nassert(isequal(find_common_edge(T,e),row_idx) || isequal(find_common_edge(T,e),row_idx'))\r\n\r\n%% Empty set test\r\nT = [2 3 5;...\r\n     3 5 7;...\r\n     5 7 11;...\r\n     7 11 13];\r\n\r\ne = [6 28];\r\n\r\nassert(isempty(find_common_edge(T,e)))\r\n\r\n\r\n%% Forbidden functions\r\nfiletext = fileread('find_common_edge.m');\r\nillegal = contains(filetext, 'regexp') || contains(filetext, 'str2num') || contains(filetext, 'assignin') || contains(filetext, 'echo')\r\nassert(~illegal);","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":149128,"edited_by":149128,"edited_at":"2025-07-26T07:50:32.000Z","deleted_by":null,"deleted_at":null,"solvers_count":44,"test_suite_updated_at":"2025-07-09T05:45:58.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-01T17:21:36.000Z","updated_at":"2026-05-24T23:29:26.000Z","published_at":"2019-12-01T18:01:01.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eFirst input is T, a triplet list of indices. Second input is e = [e1 e2], a row vector, couple of indices (positive distinct integers always sorted in ascending order, ie\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ee1 \u0026lt; e2\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ). The goal of this function is to find and return the indices of the rows in the list which contain this particular edge. Output format can be either a column or a row vector.\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\u003eFor example if inputs are\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[T = [1 2 3 ;\\n     1 3 4 ;\\n     1 4 2 ;\\n     2 3 4]]]\u003e\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\u003eand\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[e = [2 3]]]\u003e\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\u003ethe output is the vector\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[row_idx = [1 4]]]\u003e\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\u003esince [2 3] is contained in rows number 1 and 4 of T. With the same input T, but with e = [2 4] this time, the output is the vector row_idx = [3 4], since [2 4] is contained in rows number 3 and 4 of T (Note that\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eedge [b a] is the same as edge [a b]\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e so must be the corresponding outputs). If the edge is not in the list, the function must of course return the empty set.\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\u003e\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\u003eSee also\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/cody/groups/95796\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMesh generation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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:hyperlink w:docLocation=\\\"https://fr.mathworks.com/matlabcentral/fileexchange/77004-mesh-processing-toolbox?s_tid=srchtitle\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eMesh processing toolbox\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\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\"}]}"},{"id":50574,"title":"Number Puzzle - 093","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 20.9091px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 10.4545px; transform-origin: 406.996px 10.4545px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 383.991px 10.4545px; text-align: left; transform-origin: 383.999px 10.4545px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGive a set of three numbers \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, and \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e such that concatenating a^2, b^2, and c^2 gives a square number.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y=puzzle_093()\r\n  y=[1 2 3];\r\nend","test_suite":"%%\r\ny=puzzle_093();\r\ny=y.^2;\r\naa=strcat(num2str(y(1)),num2str(y(2)),num2str(y(3)));\r\na=str2num(aa);\r\nassert(isequal(length(unique(y)),3))\r\nassert(isequal(floor(sqrt(a)),ceil(sqrt(a))))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":26,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-02-26T00:40:45.000Z","updated_at":"2026-05-02T21:50:57.000Z","published_at":"2021-02-26T00:40:45.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\u003eGive a set of three numbers \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e, \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e, and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr/\u003e\u003cw:t\u003e such that concatenating a^2, b^2, and c^2 gives a square number.\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\"}]}"},{"id":51297,"title":"Number Puzzle - 106","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 41.8182px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 406.989px 20.9091px; transform-origin: 406.996px 20.9091px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 383.991px 20.9091px; text-align: left; transform-origin: 383.999px 20.9091px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eLet \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e be an integer and \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e is equal to \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea+1\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. Let \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e be an integer formed by concatenating \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e and \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003eb\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. Give examples of three unique \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e for which \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ec \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eis a square. Give your answer in the following form y=[c1 c2 c3].\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = puzzle_106()\r\n  y = [1 2 3];\r\nend","test_suite":"%%\r\ny=puzzle_106();\r\nassert(isequal(length(unique(y)),3))\r\nfor i=1:3\r\n   a=num2str(y(i));\r\n   b=num2str(y(i)+1);\r\n   c=str2num(strcat(a,b));\r\n   assert(isequal(sqrt(c),floor(sqrt(c))))\r\nend\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":27,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-04-05T18:47:05.000Z","updated_at":"2026-05-03T18:39:06.000Z","published_at":"2021-04-05T18:48:10.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\u003eLet \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be an integer and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is equal to \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea+1\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Let \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e be an integer formed by concatenating \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eb\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Give examples of three unique \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for which \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ec \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003eis a square. Give your answer in the following form y=[c1 c2 c3].\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\"}]}"},{"id":2629,"title":"Check transmitted data follow even parity (True or false) ","description":"Check transmitted data follow even parity (True or false) \r\n\r\n\u003chttp://en.wikipedia.org/wiki/Parity_bit/ Parity Bit\u003e\r\n\r\nSay, '0101', follow even parity because number of 1 are even, answer is true. \r\n\r\n\r\n'0111', it has 3 one, answer is false. \r\n","description_html":"\u003cp\u003eCheck transmitted data follow even parity (True or false)\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Parity_bit/\"\u003eParity Bit\u003c/a\u003e\u003c/p\u003e\u003cp\u003eSay, '0101', follow even parity because number of 1 are even, answer is true.\u003c/p\u003e\u003cp\u003e'0111', it has 3 one, answer is false.\u003c/p\u003e","function_template":"function y = even_parity(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = '0101';\r\ny_correct = 1;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '0100';\r\ny_correct = 0;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '0111';\r\ny_correct = 0;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '1111';\r\ny_correct = 1;\r\nassert(isequal(even_parity(x),y_correct))\r\n%%\r\nx = '0000';\r\ny_correct = 1;\r\nassert(isequal(even_parity(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":27760,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":59,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-10-13T14:15:24.000Z","updated_at":"2026-05-11T01:29:01.000Z","published_at":"2014-10-13T14:15:23.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCheck transmitted data follow even parity (True or false)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Parity_bit/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eParity Bit\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSay, '0101', follow even parity because number of 1 are even, answer is true.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e'0111', it has 3 one, answer is false.\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\"}]}"},{"id":2007,"title":"Swap two numbers","description":"Example \r\n\r\nInput:\r\n\r\n a = 10\r\n b = 20\r\n\r\nOutput\r\n\r\n a = 20\r\n b = 10\r\n","description_html":"\u003cp\u003eExample\u003c/p\u003e\u003cp\u003eInput:\u003c/p\u003e\u003cpre\u003e a = 10\r\n b = 20\u003c/pre\u003e\u003cp\u003eOutput\u003c/p\u003e\u003cpre\u003e a = 20\r\n b = 10\u003c/pre\u003e","function_template":"function [aOut,bOut] = swapit(aIn,bIn)\r\n  aOut = 0;\r\n  bOut = 0;\r\nend","test_suite":"%%\r\naIn = 10;\r\nbIn = 20;\r\naOut_correct = 20;\r\nbOut_correct = 10;\r\n[aOut,bOut] = swapit(aIn,bIn);\r\n\r\nassert(isequal(aOut, aOut_correct))\r\nassert(isequal(bOut, bOut_correct))\r\n\r\n%%\r\n\r\naIn = 0;\r\nbIn = -3;\r\naOut_correct = -3;\r\nbOut_correct = 0;\r\n[aOut,bOut] = swapit(aIn,bIn);\r\n\r\nassert(isequal(aOut, aOut_correct))\r\nassert(isequal(bOut, bOut_correct))\r\n","published":true,"deleted":false,"likes_count":5,"comments_count":3,"created_by":1388,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":785,"test_suite_updated_at":"2013-11-20T16:20:49.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-11-19T07:42:21.000Z","updated_at":"2026-05-19T06:38:53.000Z","published_at":"2013-11-19T07:42:21.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput:\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[ a = 10\\n b = 20]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutput\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[ a = 20\\n b = 10]]\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\"}]}"},{"id":2479,"title":"Mongean Shuffle","description":"A Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.\r\n\r\n* The top card of the deck is taken and put on the right hand side. \r\n* The second card from the deck on left is taken and put on top of right deck. \r\n* The third card is taken from the left and and put at the bottom of the right deck.\r\n* The fourth card is put on top of right deck.\r\n* The fifth card is put at the bottom of right deck.\r\n\r\nThis process is continued until all the cards on left are transferred to the right.\r\n\r\nThe initial state of the cards will be given. Return the state after this shuffle.","description_html":"\u003cp\u003eA Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.\u003c/p\u003e\u003cul\u003e\u003cli\u003eThe top card of the deck is taken and put on the right hand side.\u003c/li\u003e\u003cli\u003eThe second card from the deck on left is taken and put on top of right deck.\u003c/li\u003e\u003cli\u003eThe third card is taken from the left and and put at the bottom of the right deck.\u003c/li\u003e\u003cli\u003eThe fourth card is put on top of right deck.\u003c/li\u003e\u003cli\u003eThe fifth card is put at the bottom of right deck.\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThis process is continued until all the cards on left are transferred to the right.\u003c/p\u003e\u003cp\u003eThe initial state of the cards will be given. Return the state after this shuffle.\u003c/p\u003e","function_template":"function y = mshuffle(x)\r\n\r\n\r\nend","test_suite":"%%\r\n% trivial\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(mshuffle(x),y_correct))\r\n\r\n%%\r\nx = 1:5;\r\ny_correct = [4     2     1     3     5];\r\nassert(isequal(mshuffle(x),y_correct))\r\n\r\n\r\n%%\r\na = magic(5);\r\na=a(:)';\r\ny_correct = [3    16     2    20     8    19     7    18     6    24    10    23    17     4    11     5    12     1    13    25    14    21    15    22     9];\r\nassert(isequal(mshuffle(a),y_correct));\r\n\r\n\r\n%%\r\nx = 7:-1:1;\r\ny_correct = [2     4     6     7     5     3     1];\r\nassert(isequal(mshuffle(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":17203,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":97,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":15,"created_at":"2014-08-04T10:33:51.000Z","updated_at":"2026-05-06T12:09:25.000Z","published_at":"2014-08-04T10:33:51.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA Mongean shuffle of an n card deck starts with putting the initial deck on the left hand side.\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\u003eThe top card of the deck is taken and put on the right hand side.\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\u003eThe second card from the deck on left is taken and put on top of right deck.\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\u003eThe third card is taken from the left and and put at the bottom of the right deck.\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\u003eThe fourth card is put on top of right deck.\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\u003eThe fifth card is put at the bottom of right deck.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis process is continued until all the cards on left are transferred to the right.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe initial state of the cards will be given. Return the state after this shuffle.\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\"}]}"},{"id":48690,"title":"Laws of motion 4","description":"Given the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 284.5px 8px; transform-origin: 284.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = your_fcn_name(u,v,a)\r\n  y = x;\r\nend","test_suite":"%%\r\nu=0\r\nv=1;\r\na=1;\r\ny_correct = 0.5;\r\nassert(isequal(your_fcn_name(u,v,a),y_correct))\r\n\r\n%%\r\nu=0\r\nv=10;\r\na=1;\r\ny_correct = 50;\r\nassert(isequal(your_fcn_name(u,v,a),y_correct))\r\n\r\n%%\r\nu=20\r\nv=100;\r\na=1;\r\ny_correct = 4800;\r\nassert(isequal(your_fcn_name(u,v,a),y_correct))\r\n","published":true,"deleted":false,"likes_count":10,"comments_count":5,"created_by":644918,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":2631,"test_suite_updated_at":"2021-02-01T10:35:57.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-21T17:03:05.000Z","updated_at":"2026-05-26T12:09:02.000Z","published_at":"2020-12-21T17:03:05.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\u003eGiven the initial velocity 'u', final velocity 'v' and acceleration 'a', find the distance travelled.\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\"}]}"},{"id":44862,"title":"Ratio between sum of primes and sum of factors","description":"Write a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of x.","description_html":"\u003cp\u003eWrite a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of x.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 8;\r\ny_correct = 17/6;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 12;\r\ny_correct = 28/7;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 100;\r\ny_correct = 1060/14;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":274816,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":"2019-03-12T22:32:41.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2019-03-01T22:35:36.000Z","updated_at":"2026-04-20T13:42:48.000Z","published_at":"2019-03-01T22:35:36.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWrite a function that calculates the ratio between the sum of primes numbers lower or equal to x, and the sum of the factors of x.\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\"}]}"},{"id":45337,"title":"Area-03","description":"There are two circles of equal size are inscribed inside a square. They are tangent to each other.\r\n\r\n\u003chttps://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\u003e\r\n\r\nGiven the side length of the square, find the radius of the circles.","description_html":"\u003cp\u003eThere are two circles of equal size are inscribed inside a square. They are tangent to each other.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\"\u003ehttps://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\u003c/a\u003e\u003c/p\u003e\u003cp\u003eGiven the side length of the square, find the radius of the circles.\u003c/p\u003e","function_template":"function y =inscribed_circle_3(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = 1;\r\ny_correct = .2929;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = 10;\r\ny_correct = 2.9289;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = 23.6;\r\ny_correct = 6.9123;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = 0;\r\ny_correct = 0;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)\r\n\r\n%%\r\na = pi;\r\ny_correct = 0.9202;\r\nassert(abs(inscribed_circle_3(a)-y_correct)\u003c0.001)","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-17T06:35:50.000Z","updated_at":"2026-04-16T13:09:43.000Z","published_at":"2020-02-17T06:36:40.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere are two circles of equal size are inscribed inside a square. They are tangent to each other.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://serving.photos.photobox.com/4629487514d477b90123a8d594e9bdaa5ddba8e2ac82569375c49cd5551dd3acffb751ed.jpg\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the side length of the square, find the radius of the circles.\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\"}]}"},{"id":42823,"title":"Babylonian method","description":"Calculate the square root of a given positive number a using the Babylonian method\r\n(https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method).\r\nUse 1 as starting point and calculate the nth iteration step!\r\n\r\n\r\n\r\n","description_html":"\u003cp\u003eCalculate the square root of a given positive number a using the Babylonian method\r\n(https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method).\r\nUse 1 as starting point and calculate the nth iteration step!\u003c/p\u003e","function_template":"function y = Babylonian(a,n)\r\n  y = x;\r\nend","test_suite":"%%\r\na=1;\r\nn=1;\r\ny_correct=1;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=10;\r\nn=1;\r\ny_correct=1;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=2;\r\nn=10;\r\ny_correct=1.4142;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=4;\r\nn=10;\r\ny_correct=2;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=0.25;\r\nn=10;\r\ny_correct=0.5;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);\r\n\r\n%%\r\na=30;\r\nn=4;\r\ny_correct=6.0795;\r\nassert(abs(Babylonian(a,n)-y_correct)\u003c0.001);","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":73322,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":46,"test_suite_updated_at":"2016-04-24T17:03:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-04-24T17:01:50.000Z","updated_at":"2026-04-14T12:32:35.000Z","published_at":"2016-04-24T17:01:50.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate the square root of a given positive number a using the Babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method). Use 1 as starting point and calculate the nth iteration step!\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\"}]}"},{"id":46848,"title":"Modulo of sum of square of first n primes with 24","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 199.6px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 99.8px; transform-origin: 407px 99.8px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFind the modulo of sum of square of first n primes with 24.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e For n = 1,  mod(2^2,24) = 4\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e For n = 2, mod(2^2 + 3^2,24) = 13\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e For n = 4, mod(2^2 + 3^2 + 5^2 + 7^2,24) = 15\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eNote: n can be very large.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.8px; 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; perspective-origin: 384px 10.4px; text-align: left; transform-origin: 384px 10.4px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eHint : refer tag or check the modulo of square of primes(greater than 3) with 24 to observe the pattern\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = modp24(n)\r\n  %...rather than a brute force approach, try finding a pattern in primes square and 24 :)\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 4;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 13;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 4;\r\ny_correct = 15;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 15;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 120;\r\ny_correct = 11;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 1000;\r\ny_correct = 3;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 10^9;\r\ny_correct = 3;\r\nassert(isequal(modp24(x),y_correct))\r\n%%\r\nx = 10^12 + 15;\r\ny_correct = 18;\r\nassert(isequal(modp24(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":442401,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":20,"test_suite_updated_at":"2020-10-17T08:26:39.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-10-17T08:22:52.000Z","updated_at":"2026-04-14T12:35:26.000Z","published_at":"2020-10-17T08:26:39.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\u003eFind the modulo of sum of square of first n primes with 24.\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\u003eExample:\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\u003e For n = 1,  mod(2^2,24) = 4\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\u003e For n = 2, mod(2^2 + 3^2,24) = 13\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\u003e For n = 4, mod(2^2 + 3^2 + 5^2 + 7^2,24) = 15\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\u003eNote: n can be very large.\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\u003eHint : refer tag or check the modulo of square of primes(greater than 3) with 24 to observe the pattern\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\"}]}"},{"id":44246,"title":"Delete the column with all 0 in the TABLE","description":"In the given table (T), delete the column with all 0 data.\r\n\r\ne.g.\r\n\r\ninput\r\n\r\n\r\n    Banana    Apple    Orange    Mellon\r\n    ______    _____    ______    ______\r\n\r\n    0         71       0          2    \r\n    0          5       0          4    \r\n    0         64       0         34  \r\n  \r\noutput\r\n\r\n    Apple    Mellon\r\n    _____    ______\r\n\r\n    71        2    \r\n     5        4    \r\n    64       34   ","description_html":"\u003cp\u003eIn the given table (T), delete the column with all 0 data.\u003c/p\u003e\u003cp\u003ee.g.\u003c/p\u003e\u003cp\u003einput\u003c/p\u003e\u003cpre\u003e    Banana    Apple    Orange    Mellon\r\n    ______    _____    ______    ______\u003c/pre\u003e\u003cpre\u003e    0         71       0          2    \r\n    0          5       0          4    \r\n    0         64       0         34  \u003c/pre\u003e\u003cp\u003eoutput\u003c/p\u003e\u003cpre\u003e    Apple    Mellon\r\n    _____    ______\u003c/pre\u003e\u003cpre\u003e    71        2    \r\n     5        4    \r\n    64       34   \u003c/pre\u003e","function_template":"function newT = myTable(T)\r\n  newT = T;\r\nend","test_suite":"%% 1\r\nBanana = [0;0;0];\r\nApple = [71;5;64];\r\nOrange = [0;0;0];\r\nMellon= [2;4;34];\r\nT = table(Banana,Apple,Orange,Mellon);\r\n\r\nT_correct =table(Apple,Mellon) ;\r\nassert(isequal(myTable(T),T_correct))\r\n\r\n\r\n%% 2\r\nTulip = [0;43;38;40;49];\r\nLily = [71;0;64;67;64];\r\nAmaryllis = [5;163;131;0;70];\r\nHyacinth= [0; 0 ; 0 ; 0 ; 0 ];\r\nCrocus = [124; 0 ; 4 ; 3 ; 122 ];\r\n\r\nT = table(Tulip,Lily,Amaryllis,Hyacinth,Crocus);\r\nT_correct =table(Tulip,Lily,Amaryllis,Crocus) ;\r\nassert(isequal(myTable(T),T_correct))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":102298,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":35,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-07-02T08:12:31.000Z","updated_at":"2026-04-12T01:17:01.000Z","published_at":"2017-07-02T09:15:34.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn the given table (T), delete the column with all 0 data.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ee.g.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003einput\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[    Banana    Apple    Orange    Mellon\\n    ______    _____    ______    ______\\n\\n    0         71       0          2    \\n    0          5       0          4    \\n    0         64       0         34]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eoutput\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[    Apple    Mellon\\n    _____    ______\\n\\n    71        2    \\n     5        4    \\n    64       34]]\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\"}]}"},{"id":44472,"title":"A kind of decryption","description":"Please convert the vector to letters by referring to the examples below.\r\n\r\n(eg.1) input vec=[34 1 59] \u003e\u003e\u003e output s='A Z'\r\n\r\n(eg.2) input vec=[66 1 67 1 68] \u003e\u003e\u003e output s='a b c'","description_html":"\u003cp\u003ePlease convert the vector to letters by referring to the examples below.\u003c/p\u003e\u003cp\u003e(eg.1) input vec=[34 1 59] \u0026gt;\u0026gt;\u0026gt; output s='A Z'\u003c/p\u003e\u003cp\u003e(eg.2) input vec=[66 1 67 1 68] \u0026gt;\u0026gt;\u0026gt; output s='a b c'\u003c/p\u003e","function_template":"function s = decryp(vec)\r\n  s='';\r\nend","test_suite":"%% 1\r\nx = [19 17 18 25];\r\ny_correct = '2018';\r\nassert(isequal(decryp(x),y_correct))\r\n%% 2\r\nx = [46 34 53 45 34 35];\r\ny_correct = 'MATLAB';\r\nassert(isequal(decryp(x),y_correct))\r\n%% 3\r\nx = [34 1 41 66 81 81 90 1 47 70 88 1 58 70 66 83 1 2 2];\r\ny_correct = 'A Happy New Year !!';\r\nassert(isequal(decryp(x),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":137687,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":34,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2017-12-26T03:18:52.000Z","updated_at":"2026-04-28T09:39:14.000Z","published_at":"2017-12-26T03:49:45.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ePlease convert the vector to letters by referring to the examples below.\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\u003e(eg.1) input vec=[34 1 59] \u0026gt;\u0026gt;\u0026gt; output s='A Z'\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\u003e(eg.2) input vec=[66 1 67 1 68] \u0026gt;\u0026gt;\u0026gt; output s='a b c'\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\"}]}"},{"id":3010,"title":"Self-similarity 1 - Every other term","description":"Self-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the \u003chttps://oeis.org/selfsimilar.html OEIS page\u003e for more information.\r\n\r\nIn this problem, you are to check if the sequence is self-similar by every other term. The problem set assumes that you use the easiest route: take the first element and then every other element thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.\r\n\r\nFor example,\r\n\r\n* seq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]\r\n* seq_every_other = [0,  ,  1, , 1, , 2, , 1, , 2, , 2, , 3, ,] (extra commas are instructional and should not be in the every-other series) \r\n* seq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3]\r\n\r\nSince seq_every_other = seq_orig_first_half, the set is self-similar.\r\n\r\nThis problem is related to \u003chttps://www.mathworks.com/matlabcentral/cody/problems/3011-self-similarity-2-every-third-term Problem 3011\u003e and \u003chttps://www.mathworks.com/matlabcentral/cody/problems/3012-self-similarity-3-every-other-pair-of-terms Problem 3012\u003e.","description_html":"\u003cp\u003eSelf-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the \u003ca href = \"https://oeis.org/selfsimilar.html\"\u003eOEIS page\u003c/a\u003e for more information.\u003c/p\u003e\u003cp\u003eIn this problem, you are to check if the sequence is self-similar by every other term. The problem set assumes that you use the easiest route: take the first element and then every other element thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.\u003c/p\u003e\u003cp\u003eFor example,\u003c/p\u003e\u003cul\u003e\u003cli\u003eseq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]\u003c/li\u003e\u003cli\u003eseq_every_other = [0,  ,  1, , 1, , 2, , 1, , 2, , 2, , 3, ,] (extra commas are instructional and should not be in the every-other series)\u003c/li\u003e\u003cli\u003eseq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3]\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eSince seq_every_other = seq_orig_first_half, the set is self-similar.\u003c/p\u003e\u003cp\u003eThis problem is related to \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/3011-self-similarity-2-every-third-term\"\u003eProblem 3011\u003c/a\u003e and \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/3012-self-similarity-3-every-other-pair-of-terms\"\u003eProblem 3012\u003c/a\u003e.\u003c/p\u003e","function_template":"function [tf] = self_similarity_1(seq)\r\n\r\ntf = 0;\r\n\r\nend","test_suite":"%%\r\nseq = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 8, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 2, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 2];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 2, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 8, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32, 8, 16, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 390, 390, 54, 630, 174, 366];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 3, 2, 5, 1, 4, 4, 4, 2, 7, 3, 4, 2, 5, 3, 9, 2, 5, 5, 4, 1, 11, 4, 7, 4, 6, 4, 10, 2, 7, 7, 7, 3, 13, 4, 7, 2, 9, 5, 14, 3, 8, 9, 10, 2, 16, 8, 9, 5, 9, 5, 21, 1, 11, 11, 10, 4, 17, 7, 10, 4, 11, 6, 11, 4, 16, 10, 11, 2, 23, 7, 12, 7, 14, 7, 20, 3];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2, 0, 0, 2, 1, 1, 2, 1, 1, 1, 1, 0, 2, 0, 0, 2, 2, 1, 2, 0, 1, 2, 0, 1, 3, 0, 0, 2, 1, 0, 2, 2, 1, 1, 0, 0, 3, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96, 336, 192, 576, 24, 432, 312, 480, 144, 768, 288, 576, 96, 744, 336, 960, 192, 720, 576, 768, 24, 1152, 432, 1152, 312, 912, 480, 1344, 144, 1008, 768, 1056, 288, 1872, 576, 1152, 96, 1368, 744, 1728, 336];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 2, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 1, 0, 1, 2, 0, 0, 2, 1, 1, 2, 1, 1, 2, 1, 0, 2, 0, 0, 2, 2, 1, 2, 0, 1, 2, 0, 1, 3, 0, 0, 2, 1, 0, 2, 2, 1, 1, 0, 0, 3, 1, 2, 2, 1, 0, 2, 0, 1, 2, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 2, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 2, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 0, 2, 2, 1, 0, 1, 0, 1, 2, 2, 0, 1, 3, 0, 1, 2, 2, 2, 2, 1, 2, 0, 4, 1, 0, 0, 0, 2, 0, 2, 0, 2, 2, 0, 0, 1, 3, 3, 0, 0, 2, 1, 4, 2, 0, 2, 2, 2, 0, 2, 2, 1, 0, 2, 0, 0, 0, 4, 0, 1, 2, 0, 3, 0, 4, 0, 2, 2, 1, 0, 2, 2, 0, 0, 2, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 3, 2, 3, 2];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 4, 4, 0, 4, 8, 0, 0, 4, 4, 8, 0, 0, 8, 0, 0, 4, 8, 4, 0, 8, 0, 0, 0, 0, 12, 8, 0, 0, 8, 0, 0, 4, 0, 8, 0, 4, 8, 0, 0, 8, 8, 0, 0, 0, 8, 0, 0, 0, 4, 12, 0, 8, 8, 0, 0, 0, 0, 8, 0, 0, 8, 0, 0, 4, 16, 0, 0, 8, 0, 0, 0, 4, 8, 8, 0, 0, 0, 0, 0, 8, 4, 8, 0, 0, 16, 0, 0, 0, 8, 8, 0, 0, 0, 0, 0, 0, 8, 4, 0, 12, 8];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 24, 24, 96, 24, 144, 96, 192, 24, 312, 144, 288, 96, 336, 192, 576, 24, 432, 312, 480, 144, 768, 288, 576, 96, 744, 336, 960, 192, 720, 576, 768, 24, 1152, 432, 1152, 312, 912, 480, 1344, 312, 1008, 768, 1056, 288, 1872, 576, 1152, 96, 1368, 744, 1728, 336];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 2, 2, 4, 2, 4, 4, 8, 2, 4, 4, 8, 4, 4, 8, 16, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 16, 16, 8, 16, 16, 32, 8, 8, 16, 32, 16, 32, 32, 64, 2, 4, 4, 8, 4, 8, 8, 16, 4, 8, 8, 16, 8, 16, 16, 32, 4, 8, 8, 16, 8, 16, 16, 32];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 6, 6, 30, 6, 30, 30, 54, 6, 102, 30, 78, 30, 78, 54, 150, 6, 102, 102, 126, 30, 270, 78, 150, 30, 150, 78, 318, 54, 174, 150, 198, 6, 390, 102, 270, 102, 222, 126, 390, 30, 246, 270, 270, 78, 510, 150, 294, 30, 390, 150, 510, 78, 318, 318, 390, 54, 630, 174, 366];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 2, 1, 4, 3, 3, 2, 3, 2, 2, 1, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 6, 5, 5, 4, 5, 3, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, 7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 2, 1, 2, 2, 2, 1, 4, 2, 3, 2, 3, 2, 5, 1, 4, 4, 4, 2, 7, 3, 4, 2, 5, 3, 9, 2, 5, 5, 5, 1, 11, 4, 7, 4, 6, 4, 10, 2, 7, 7, 7, 3, 13, 4, 7, 2, 9, 5, 14, 3, 8, 9, 10, 2, 16, 5, 9, 5, 9, 5, 21, 1, 11, 11, 10, 4, 17, 7, 10, 4, 11, 6, 18, 4, 16, 10, 11, 2, 23, 7, 12, 7, 14, 7, 20, 3];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 2, 1, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 2, 2, 1, 2, 1, 1, 2, 2];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, -1, -4, -3, 1, -2, 3, 1, -2, -1, 3, 2, -1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -1, 0, 1, 1, -2, -1, 1, 0, 1, 1, 0, 1, -5, -4, 1, -3, 4, 1, -3, -2, 5, 3, -2, 1, -3, -2, 1, -1, 4, 3, -1, 2, -3, -1, 2, 1, -3, -2, 1, -1, 2, 1, -1, 0, 1, 1, 0, 1, -1, 0, 1, 1];\r\ntf_corr = 0;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n\r\n%%\r\nseq = [0, 1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 5, 4, 7, 3, 8, 5, 7, 2, 7, 5, 8, 3, 7, 4, 5, 1, 6, 5, 9, 4, 11, 7, 10, 3, 11, 8, 13, 5, 12, 7, 9, 2, 9, 7, 12, 5, 13, 8, 11, 3, 10, 7, 11, 4, 9, 5, 6, 1, 7, 6, 11, 5, 14, 9, 13, 4, 15, 11, 18, 7, 17, 10, 13, 3, 14, 11, 19, 8, 21, 13, 18, 5, 17, 12, 19];\r\ntf_corr = 1;\r\nassert(isequal(self_similarity_1(seq),tf_corr))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":26769,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":72,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":30,"created_at":"2015-02-13T04:04:32.000Z","updated_at":"2026-04-24T15:01:30.000Z","published_at":"2015-02-13T04:04:32.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSelf-similar integer sequences are certain sequences that can be reproduced by extracting a portion of the existing sequence. See the\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=\\\"https://oeis.org/selfsimilar.html\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eOEIS page\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e for more information.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn this problem, you are to check if the sequence is self-similar by every other term. The problem set assumes that you use the easiest route: take the first element and then every other element thereafter of the original sequence, and compare that result to the first half of the original sequence. The function should return true if the extracted sequence is equal to the first half of the original sequence.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example,\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\u003eseq_original_set = [0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4]\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\u003eseq_every_other = [0, , 1, , 1, , 2, , 1, , 2, , 2, , 3, ,] (extra commas are instructional and should not be in the every-other series)\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\u003eseq_orig_first_half = [0, 1, 1, 2, 1, 2, 2, 3]\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSince seq_every_other = seq_orig_first_half, the set is self-similar.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis problem is related to\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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/3011-self-similarity-2-every-third-term\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 3011\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e and\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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/3012-self-similarity-3-every-other-pair-of-terms\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem 3012\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":61036,"title":"The MATLAB Treasure Hunt – Cross the River of Ratios by Finding Successive Proportions in the Data Stream","description":"Following the glowing script, you arrive at the River of Ratios — a flowing stream of numbers.\r\nA carved message on the rocks reads: “Only those who know the balance between every pair shall cross.”\r\nGiven a numeric vector a, calculate the ratio of each element to the previous one.\r\nReturn a vector r such that r(i) = a(i+1)/a(i) for all valid i.\r\nThis will reveal the rhythm of the river and guide your next step!","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 141px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 408px 70.5px; transform-origin: 408px 70.5px; vertical-align: baseline; \"\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eFollowing the glowing script, you arrive at the \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eRiver of Ratios\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e — a flowing stream of numbers.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eA carved message on the rocks reads: \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-style: italic; \"\u003e“Only those who know the balance between every pair shall cross.”\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a numeric vector \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ea\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e, calculate the \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eratio of each element to the previous one\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eReturn a vector \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003er\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e such that \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003er(i) = a(i+1)/a(i)\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e for all valid \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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-family: Menlo, Monaco, Consolas, \u0026quot;Courier New\u0026quot;, monospace; \"\u003ei\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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; perspective-origin: 385px 10.5px; text-align: left; transform-origin: 385px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThis will reveal the rhythm of the river and guide your next step!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = riverRatios(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na = [2 4 8 16];\r\ny_correct = [2 2 2];\r\nassert(isequal(riverRatios(a),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":4953963,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":74,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2025-10-21T09:38:42.000Z","updated_at":"2026-05-26T07:08:26.000Z","published_at":"2025-10-21T09:38:42.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eFollowing the glowing script, you arrive at the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eRiver of Ratios\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e — a flowing stream of numbers.\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\u003eA carved message on the rocks reads: \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003e“Only those who know the balance between every pair shall cross.”\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\u003eGiven a numeric vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ea\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, calculate the \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eratio of each element to the previous one\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\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\u003eReturn a vector \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003er\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e such that \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003er(i) = a(i+1)/a(i)\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e for all valid \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:rFonts w:cs=\\\"monospace\\\"/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ei\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e.\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\u003eThis will reveal the rhythm of the river and guide your next step!\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\"}]}"},{"id":61188,"title":"Compute optimal regenerative and friction brake torque blending.","description":"Electric and hybrid vehicles combine regenerative braking with traditional friction braking to maximize energy recovery while ensuring safety.\r\nGiven total braking torque demand and maximum regenerative torque capability, compute how braking effort should be split between regenerative and friction braking.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(33, 33, 33); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none; white-space: normal; \"\u003e\u003cdiv style=\"block-size: 93px; display: block; min-width: 0px; padding-block-start: 0px; padding-inline-start: 2px; padding-left: 2px; padding-top: 0px; perspective-origin: 407px 46.5px; transform-origin: 407px 46.5px; vertical-align: baseline; \"\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 383px 21px; text-align: left; transform-origin: 383px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eElectric and hybrid vehicles combine regenerative braking with traditional friction braking to maximize energy recovery while ensuring safety.\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; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 383px 21px; text-align: left; transform-origin: 383px 21px; white-space-collapse: preserve; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; \"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven total braking torque demand and maximum regenerative torque capability, compute how braking effort should be split between regenerative and friction braking.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function [Tregen, Tfric] = brakeBlending(T_total, Tregen_max)\r\nTregen = 0; Tfric = 0;\r\nend\r\n","test_suite":"%%\r\nT_total = 300; Tregen_max = 200;\r\n[Tregen,Tfric] = brakeBlending(T_total,Tregen_max);\r\nassert(isequal([Tregen Tfric],[200 100]))\r\n\r\n%%\r\nT_total = 150; Tregen_max = 200;\r\n[Tregen,Tfric] = brakeBlending(T_total,Tregen_max);\r\nassert(isequal([Tregen Tfric],[150 0]))\r\n\r\n%%\r\nT_total = 0; Tregen_max = 200;\r\n[Tregen,Tfric] = brakeBlending(T_total,Tregen_max);\r\nassert(isequal([Tregen Tfric],[0 0]))\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":2305225,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":65,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2026-02-02T07:28:49.000Z","updated_at":"2026-05-24T19:30:58.000Z","published_at":"2026-02-02T07:28:49.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eElectric and hybrid vehicles combine regenerative braking with traditional friction braking to maximize energy recovery while ensuring safety.\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\u003eGiven total braking torque demand and maximum regenerative torque capability, compute how braking effort should be split between regenerative and friction braking.\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\"}]}"},{"id":47310,"title":"Find Logic 15","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 221.619px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 174px 110.81px; transform-origin: 174px 110.81px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGuess the Logic!\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(1) = 1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(2) = 8\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(3) = 9\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(4) = 64\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 20.9524px; 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; perspective-origin: 151px 10.4762px; text-align: left; transform-origin: 151px 10.4762px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(5) = 25\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 41.9048px; 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; perspective-origin: 151px 20.9524px; text-align: left; transform-origin: 151px 20.9524px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eMake a function logic(x) which will return 'x' th term of sequence.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = logic(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 1;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 2;\r\ny_correct = 8;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 5;\r\ny_correct = 25;\r\nassert(isequal(logic(x),y_correct))\r\n\r\n%%\r\nx = 6;\r\ny_correct = 216;\r\nassert(isequal(logic(x),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":293792,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":457,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-11-05T14:25:25.000Z","updated_at":"2026-05-25T07:16:47.000Z","published_at":"2020-11-05T14:25:25.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\u003eGuess the Logic!\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\u003elogic(1) = 1\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\u003elogic(2) = 8\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\u003elogic(3) = 9\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\u003elogic(4) = 64\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\u003elogic(5) = 25\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\u003eMake a function logic(x) which will return 'x' th term of sequence.\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\"}]}"},{"id":50892,"title":"Draw a '7' in a zero matrix!","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 441px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 220.5px; transform-origin: 407px 220.5px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a x-by-x matrix filled with zeros (x is odd and \u0026gt; 3). Use 7s to draw a number 7 into it! Like this:\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex = 5, y =\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e7\t7\t7\t7\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003ex = 7, y = \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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e7\t7\t7\t7\t7\t7\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0\t7\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e0\t0\t0\t0\t0\t0      7\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = seven(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 5;\r\ny_correct = [7 7 7 7 7;0 0 0 0 7;0 0 0 0 7;0 0 0 0 7;0 0 0 0 7];\r\nassert(isequal(seven(x),y_correct))\r\n\r\n%%\r\nx = 7;\r\ny_correct = [7 7 7 7 7 7 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7;0 0 0 0 0 0 7];\r\nassert(isequal(seven(x),y_correct))\r\n\r\n%%\r\nx = 9;\r\ny_correct = [7 7 7 7 7 7 7 7 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7;0 0 0 0 0 0 0 0 7];\r\nassert(isequal(seven(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":6,"comments_count":0,"created_by":921257,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":674,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-03-10T06:26:49.000Z","updated_at":"2026-05-26T09:33:13.000Z","published_at":"2021-03-10T06:26:49.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\u003eGiven a x-by-x matrix filled with zeros (x is odd and \u0026gt; 3). Use 7s to draw a number 7 into it! Like this:\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\u003ex = 5, y =\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\u003e7\\t7\\t7\\t7\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t7\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\u003ex = 7, y = \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\u003e7\\t7\\t7\\t7\\t7\\t7\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0\\t7\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\u003e0\\t0\\t0\\t0\\t0\\t0      7\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\"}]}"},{"id":1443,"title":"Edges of a n-dimensional Hypercube","description":"Return the number of edges on an \u003chttp://en.wikipedia.org/wiki/Hypercube _n_-dimensional hypercube\u003e (with an integer n \u0026ge; 0).\r\n\r\nNeither *string operations* nor *interpolations* are allowed!\r\n","description_html":"\u003cp\u003eReturn the number of edges on an \u003ca href = \"http://en.wikipedia.org/wiki/Hypercube\"\u003e\u003ci\u003en\u003c/i\u003e-dimensional hypercube\u003c/a\u003e (with an integer n \u0026ge; 0).\u003c/p\u003e\u003cp\u003eNeither \u003cb\u003estring operations\u003c/b\u003e nor \u003cb\u003einterpolations\u003c/b\u003e are allowed!\u003c/p\u003e","function_template":"function E = hypercube_edges(n)\r\n  E = n;\r\nend","test_suite":"%%\r\nuser_solution = fileread('hypercube_edges.m');\r\nassert(isempty(strfind(user_solution,'regexp')));\r\nassert(isempty(strfind(user_solution,'2str')));\r\nassert(isempty(strfind(user_solution,'str2')));\r\nassert(isempty(strfind(user_solution,'interp')));\r\nassert(isempty(strfind(user_solution,'printf')));\r\nassert(isempty(strfind(user_solution,'assert')));\r\n\r\n%%\r\nn = 0;\r\nE_correct = 0;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 1;\r\nE_correct = 1;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 2;\r\nE_correct = 4;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 3;\r\nE_correct = 12;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 4;\r\nE_correct = 32;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 5;\r\nE_correct = 80;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 6;\r\nE_correct = 192;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 7;\r\nE_correct = 448;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 8;\r\nE_correct = 1024;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 9;\r\nE_correct = 2304;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 10;\r\nE_correct = 5120;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 11;\r\nE_correct = 11264;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 12;\r\nE_correct = 24576;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 13;\r\nE_correct = 53248;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 14;\r\nE_correct = 114688;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n\r\n%%\r\nn = 15;\r\nE_correct = 245760;\r\nassert(isequal(hypercube_edges(n),E_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":1,"created_by":10352,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":89,"test_suite_updated_at":"2013-04-28T07:06:47.000Z","rescore_all_solutions":false,"group_id":20,"created_at":"2013-04-22T11:46:41.000Z","updated_at":"2026-04-27T13:36:56.000Z","published_at":"2013-04-22T11:47:26.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eReturn the number of edges on an\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://en.wikipedia.org/wiki/Hypercube\\\"\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e-dimensional hypercube\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e (with an integer n ≥ 0).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNeither\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003estring operations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e nor\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003einterpolations\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e are allowed!\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\"}]}"},{"id":1737,"title":"The sum of individual numbers...","description":"Well this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 (only if the original is 0 the answer will be 0).  For example:\r\n  \r\n  x = [103]; So ---\u003e 1+0+3 = 4\r\n  output  = 4;\r\n\r\nanother example:\r\n\r\n  x = [99]; So ---\u003e 9+9 = 18  ---\u003e 1+8 = 9\r\n  output  = 9;\r\n\r\nanother example:\r\n  \r\n  x = [1199]; So ---\u003e 1+1+9+9 = 20  ---\u003e 2+0 = 2\r\n  output  = 2;\r\n\r\n\r\nanother example:\r\n\r\n  x = [11 3]; So ---\u003e 1+1 = 2 and  3 = 3\r\n  output  = [2 3];\r\n","description_html":"\u003cp\u003eWell this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 (only if the original is 0 the answer will be 0).  For example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [103]; So ---\u003e 1+0+3 = 4\r\noutput  = 4;\r\n\u003c/pre\u003e\u003cp\u003eanother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [99]; So ---\u003e 9+9 = 18  ---\u003e 1+8 = 9\r\noutput  = 9;\r\n\u003c/pre\u003e\u003cp\u003eanother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [1199]; So ---\u003e 1+1+9+9 = 20  ---\u003e 2+0 = 2\r\noutput  = 2;\r\n\u003c/pre\u003e\u003cp\u003eanother example:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ex = [11 3]; So ---\u003e 1+1 = 2 and  3 = 3\r\noutput  = [2 3];\r\n\u003c/pre\u003e","function_template":"function y = individualNumSum(x)\r\ny = x;\r\nend","test_suite":"%%\r\nx = [1];\r\ny = [1];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx = [103];\r\ny = [4];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[189 22 39 88 55 485 769 215 3685 4589];\r\ny = [9 4 3 7 1 8 4 8 4 8];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[1111 2222 3333 4444 5555 6666 7777 8888 9999 0];\r\ny = [4 8 3 7 2 6 1 5 9 0];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[111 222 333 444 555 666 777 888 999 0];\r\ny = [3 6 9 3 6 9 3 6 9 0];\r\nassert(isequal(individualNumSum(x),y))\r\n%%\r\nx=[11 3];\r\ny = [2 3];\r\nassert(isequal(individualNumSum(x),y))","published":true,"deleted":false,"likes_count":3,"comments_count":0,"created_by":15013,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":87,"test_suite_updated_at":"2013-07-22T18:34:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-22T18:22:26.000Z","updated_at":"2026-05-22T08:22:38.000Z","published_at":"2013-07-22T18:34:35.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWell this one is taking a number and then summing the individual parts till you reach a value of 1, 2, 3, 4, 5, 6, 7, 8, 9, or 0 (only if the original is 0 the answer will be 0). For example:\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[x = [103]; So ---\u003e 1+0+3 = 4\\noutput  = 4;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother example:\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[x = [99]; So ---\u003e 9+9 = 18  ---\u003e 1+8 = 9\\noutput  = 9;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother example:\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[x = [1199]; So ---\u003e 1+1+9+9 = 20  ---\u003e 2+0 = 2\\noutput  = 2;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eanother example:\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[x = [11 3]; So ---\u003e 1+1 = 2 and  3 = 3\\noutput  = [2 3];]]\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\"}]}"},{"id":2793,"title":"Guess","description":"A random number between 1 and 10 is created for the variable y. Guess what its value is.","description_html":"\u003cp\u003eA random number between 1 and 10 is created for the variable y. Guess what its value is.\u003c/p\u003e","function_template":"function y = guess(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 10;\r\ny_correct = randi(x);\r\nassert(isequal(guess(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":1,"created_by":33304,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":90,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-12-17T14:28:15.000Z","updated_at":"2026-02-18T16:36:34.000Z","published_at":"2014-12-17T14:28:15.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eA random number between 1 and 10 is created for the variable y. Guess what its value is.\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\"}]}"},{"id":44882,"title":"Opposite point of the earth, what is the antipodal of a point ?","description":"Given two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u003cnothing\u003e', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\r\n\r\n*Extra question:* What is the opposite point of north pole? And why is not possible to calculate it by this method ?\r\n\r\nSuppose the earth is spherical, not flat (Lol)","description_html":"\u003cp\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal).  \r\n The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). \r\nYou have to return two strings (lat and long) with the same format that the input.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExtra question:\u003c/b\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\u003c/p\u003e\u003cp\u003eSuppose the earth is spherical, not flat (Lol)\u003c/p\u003e","function_template":"function [lat_o,long_o] = opposite_earth_point(lat,long)\r\n  [lat_o long_o] = [lat long];\r\nend","test_suite":"%% \r\n%Mathworks headquarters\r\nlat = '42.3 N';\r\nlong = '71.37 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '42.3 S';\r\nlong_o_correct = '108.63 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%% \r\n%San Antonio\r\nlat = '29.31 N';\r\nlong = '98.46 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct = '29.31 S';\r\nlong_o_correct= '81.54 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%My city \r\nlat = '32.9 S';\r\nlong = '68.82 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '32.9 N';\r\nlong_o_correct = '111.18 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Big Ben \r\nlat = '51.5 N';\r\nlong = '0.12 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '51.5 S';\r\nlong_o_correct = '179.88 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Wellington\r\nlat = '41.27 S';\r\nlong = '174.78 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '41.27 N';\r\nlong_o_correct = '5.22 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n%Some point of Brasil\r\nlat = '1 S';\r\nlong = '50 W';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '1 N';\r\nlong_o_correct = '130 E';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))\r\n\r\n%%\r\n% Some point near to Moscú\r\nlat = '55 N';\r\nlong = '37 E';\r\n[lat_o long_o]=opposite_earth_point(lat,long);\r\nlat_o_correct= '55 S';\r\nlong_o_correct = '143 W';\r\nassert(isequal([lat_o long_o],[lat_o_correct long_o_correct]))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":289312,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":18,"test_suite_updated_at":"2019-04-18T18:26:43.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-04-18T18:22:19.000Z","updated_at":"2026-03-16T13:49:41.000Z","published_at":"2019-04-18T18:22:19.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven two strings(lat and long) that represent the geographic coordinates of a point in the earth, you have to find out what is the opposite or most farthest point of the earth from that point(antipodal). The strings will be 'r.dd C', where r is the real part, dd(the mantissa in decimal, not in minutes and dd can be present or not with the form dd,d or '\u0026lt;nothing\u0026gt;', equal the point(.)) and C the cardinal point (S,N,E or W). You have to return two strings (lat and long) with the same format that the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExtra question:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e What is the opposite point of north pole? And why is not possible to calculate it by this method ?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSuppose the earth is spherical, not flat (Lol)\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\"}]}"},{"id":57884,"title":"Find  gradient of a numeric data which has same size as the existing vector.","description":"**** Refer matlab documentation about finding gradient ****\r\nConvert the entire gradient vector to least integer form. (Probably the easiest problem ever)","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407.5px 25.5px; transform-origin: 407.5px 25.5px; vertical-align: baseline; \"\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; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e**** Refer matlab documentation about finding gradient ****\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; perspective-origin: 384.5px 10.5px; text-align: left; transform-origin: 384.5px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eConvert the entire gradient vector to least integer form. (Probably the easiest problem ever)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y =gradient_vector(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = [1 1 1 1 1];\r\nassert(isequal(gradient_vector(x),y_correct))\r\n\r\n\r\n%%\r\nx = [82    91    13    92    64    10    28    55    96    97    16    98    96    49    81    15    43    92    80    96];\r\n\r\ny_correct = [9   -35     0    25   -41   -18    22    34    21   -40     0    40   -25    -8   -17   -19    38    18     2    16];\r\nassert(isequal(gradient_vector(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":1809490,"edited_by":1809490,"edited_at":"2023-04-03T05:47:13.000Z","deleted_by":null,"deleted_at":null,"solvers_count":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-04-03T05:47:05.000Z","updated_at":"2026-03-16T10:43:54.000Z","published_at":"2023-04-03T05:47:13.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003e**** Refer matlab documentation about finding gradient ****\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\u003eConvert the entire gradient vector to least integer form. (Probably the easiest problem ever)\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\"}]}"},{"id":54285,"title":"Palindrome Problem 1","description":"Continued Problem 50033: A palindrome  is one-thirteenth of the sum of  and , where  and  are also palindrome. Give an example of . ","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 43.9px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 331.5px 21.95px; transform-origin: 331.5px 21.95px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 308.5px 21.95px; text-align: left; transform-origin: 308.5px 21.95px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eContinued Problem 50033: A palindrome \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003ep\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e is one-thirteenth of the sum of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAtCAYAAADcMyneAAAAAXNSR0IArs4c6QAAA05JREFUWEft2FvIbVMYBuBnIyWnhAsUEUnkkLBFkTaRnMmZ4gI57NDeOct248ax5OyCnCLHG3HDxaZdXCAhSsohKcohEdGrb2iazf/3/2ux1n+xRq3Wao455nzH+33f+71jLbPEx7Iljs8M4LgRmjE4Y3BcBnrrN8Y5OBcH4Fu8gDvxLv7ov2+SObgZbsfxeAcbYXkB+qxAvz4tgCHiMuyOa/FNAdkJd+FoPIfz8V0X5KQY3AZ34AZ81GNpfzxf147B29MAuA/2wwMDebY1HscKHIy10wA4X61ticewFU7DJ0sN4K54CimQ1fhlqQE8EbfhzH54A3RSRTJXiLfAfVUYt+K3acnMEMANcCW2r9D+NHTTtBjMe0/HIbi6Osogy9MCGGAR5VX4er4SnwbAgLsIKwfAbY4NO51m4kVyIC6odvdFj7n05ivwUhmHv6YnyeC+uLvPUAfkDngTl+DvgpkUwF3waFms+VLuJDz7b0KdHNgOeyO7jiWK0qeProfDcBXS5HMtBiA7zmbTczN3JJ6u3825jGQthxjcDdnxxTgCXyEu40NcU6AjqLFIP9Q9b1UnuBTvIUxsiuPw4kjIatFcIc71G+vzTFXdefgZ91eo0js/xsnYo6NpcSdhfK//E2B2n4Q+u0L4Kbatnhn2Uon34mU8jINwfTF6OF4p13zqgP9bFKFzMbgznqxwxvH+XgCSa8nRW3B5Jf6PuKk0Lc+LY7655pImSYORx1wAGwt5eEo/4W26FSbj3w5F/yzRZT6aljPIWGMIYJeFAEyYc/JqI5UdMY2NT1jDZnMhzdvlrHHUkH1aLNohgLFAD+EEPIJU5vedB7f8+wCn4P3O3LG1mdeqqr9cLKCF2K0uQ2dVONu6tKOELSDzHc37tSbXr9yLO+nPjYxziMHG0LqyRKngNnbEEyUz0chXO3Np9A+W7GRjOQglTz8vORoJZB9gl6FUb/+M0EL4Bs6oImkv3hPRzE1K2POd+68r/fxPALYkj8j2+2I3hLHpkZkIdxsNfMQ7bS5/c6yZz4wuBHGfwfaS/DXRF9lUbYom59cL6yzRfUdyN/KTcU+Fe9DGLwRYu2dSbmYxmP5x7wzgyNTVwhmDMwbHZWDc9bMcHJfBPwHsq6kuL3/DIwAAAABJRU5ErkJggg==\" width=\"20\" height=\"22.5\" style=\"width: 20px; height: 22.5px;\"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAtCAYAAAAgJgIUAAAAAXNSR0IArs4c6QAAArtJREFUWEft11uozWkYx/HPRoRcOYQbh2hSikYxuKBkcuHYKIcc0hBuyJBTIYfBFTlNXGqcb4QLcrggF7iimUxuHEqNEc0FknLqqfe/2/3917b3sv/stN6btVbrXev9vs/z/J7n96/TClZdK2BQg8iyUIvEdx+JDpiIpRiHF7iCvbiK93lFtnRNBMAarMLtdNhQdEkwS3AcHxqCtDTEFCzEctxPB3XH71iEm5iFB2VBdMZuHMG1XMj7pQiMQICeLQuiL37BfrzJQXTCnhSlOThaFkRjE6BjitJs/Iwb3wKiG/7Ea/yK/78FxHCcwlqcKFuiRSkJ2YY6IiWr8eprQ0QLCElOT83rvyLKlu4T+TPGYBl+w6NKlVsmxCBsw3rca0w6ZUEEwA6swz85gKiNrnhc5hQdiE3Yib9zAO2wAA9xqSyIPjiAARVqIObIc8zDv2VAxAGHMO0z5nll6p71k7SoJiJkPTEYP2Jk8gPR+2N/VvHhFS6nsZ1NzKrMexFEhHQCZmJsCttU/IW4xWg8TSGNQ0N+MT2rXo2pYwO24EIqpvlog12IiXkSQxBGJdJQ9aoEEU4oCmwuNiYT0jsBvMVPuIiXiCjdqpog5bjo9z+km/ZPB8druKVs+kV1H05RCtBnZUBMxpnkC++mdGRNp33qASuwFZvxrqUh2qY/j24XK24aTiiTVKQlPkfRhkGpbzrVghTVRGZAQiGnC0xIqON8Uks4pYqDqalQRRDDcA698IkfRKQhFBKKiPfhlr5oFUEsxsEK9ryhajJpBnQY2/ycaDJYHiIzpAEST0zhhBo650w1PTApfRemZXuRY2oqRR4iuuUxjKqQiqiH66mL/pEGVTxxFTqmaiHGpyZ0BzMKzEgMqX2IfWFcQ55PmnpYpX1lmZpmcdUgyjA1zUpBw821dNTSkS+eVlETHwGnQ4IudpkxZgAAAABJRU5ErkJggg==\" width=\"16.5\" height=\"22.5\" style=\"width: 16.5px; height: 22.5px;\"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e, where \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003em\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e and \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: STIXGeneral, STIXGeneral-webfont, serif; font-style: italic; font-weight: 400; color: rgb(0, 0, 0);\"\u003en\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e are also palindrome. Give an example of \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"vertical-align:-5px\"\u003e\u003cimg src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG0AAAAkCAYAAACDr7TyAAAAAXNSR0IArs4c6QAAB1RJREFUaEPtmnXIrVUWh5/rqDP22BhYjNgtdncrBmMHKhY2dndg1yjOoGK3o3/YiY0tIjKDYisWdgcPrC2bc877vvv9zrn3+snZcBE5+91r7RW/9Vtrf2MYrlFngTGjTuOhwgydNgqDoK3TJgFWBB4BvhuF9/2jqTwBsCrwPPBpqXJtnDY9cCRwMfBqqYDhvkYLzAIcCJwLvNm4G4rhcUbgWOC8ocNKzNp6j/Y9pNRxJZkmJJ4GPAlcC/zaWqXhByUWWB7YEjgU+LrugxKnedAqkcK1h5VoNtxTaYG/AAcD3wSiVSZHk9NmAi4FTg/yMbT52LXAnMC/IkFeqRLV5LSdgZWBvYAvx66+w9MBs+0E4CfgOODnXlapc9pUwL+B+4BLhiYdZxZYMxy3FfBGW6ctAdwcxVESMlzjxgL/AK4Djgdub+u03YDtga1L+4dxc6c/vZSEcNY0IbKLkFTBY8LWuYFdgM//9KYa3AWdckwRtN3apI2nBCYMXvBDg6iJgVOB6aq4RJXTJo1Gz0K4P/BtjSD7uDmAxYBFY8x1NHAv8FdgU2BfwAA4Keisl/Fyq0VfslTIU9mRthVe1umCOgjtywAXAreGHhsAewDKugY4AvhkAL7yjhsCmwDzhx0eAnYAlgT2C5soylGVUyUZuTaoWkcBKwXKfdS5qcpp0wJXA88BHtCTxQTbWQiYN4y/CPB4CLPfOBOYHJg6er1no0a+G7R2DeA9wKL7flzePSNZCwIWcY2lHk/FuaKEjMwx3ERhXM/fuKpmjEQ48PcY8f0TuDwc5J3+E3PagwLuZOHbAf+tkXMY4Dn+e62t0x6LCzfdI2WmUHp2fKOznwgysy1wBZAiUCf9Lfq/xYFHB+A0dTTrlW89lvGqwzExzTG7lg1Z7l0r0KDpbqW/zxyB7iDCGeLhHROkhYGbAnFOaUiGbQCdPFadliu8I+As7Z1QWhg00o0eYeGZyLxzgO/DwA6h74oI/LjUSj321elhQdcIMrOUhT0p9QjlO4a6M+qZwSLU5xA4D3B9oIABVVd2+nJaEzym+1k/7gHEXxV/CzgrlE5saHPgoqhZsiJrV54ZTdFXYstkuNdDD4u/NcTgsBSYdf5rMlqJrM49OsE7+wKyBdA50bCE3ABYTpruqtOFb0eI/y+FxzZExDOFI7NFvL4xouiLEJbDghG+U/ZSkGfGIGpMMpx6PADsDnwQeuTBI4xbawa1ZIuSHmtVVUBILB4OgepVN7DQaQagGddFlgZB+fNsEcvNKCEwrY2youulJDip98gzoyd+t7BqbjgJgHVUx6WVgsf/V8eXWpzdtHX2YKTLhVzvmC/tbEBJzKoyMe1P9rTtknVL6LoOq1JIL+9Z0Fw75PTJZmng5ICfhOWp37OeOQ6zWdegaaXMuHIA8828Zvju58RcWEzL+1wVZGDQvaes1fJQ5ZAZop4bwDrOdiPXLfeBTFt7SAKF0a5VN3s0Mi3au8YBVc5NmSQkrdux1wZRBdYBDghml87JM6Pzt6bI7vV7nR6pYTVIhB77xUG9C2pDnSDZqgq+FDAvRhtS9/Kf7L43cH9bp00GXAC8HMbudck8k2xifRX4LBNkI3sb8FUPSEqQYmHW2da79aJNkNDIOq1DP8b3dY5s0iOvnVJ9s15qbpF/Ow4WlmxDDL66xrdTj7xWSvM7s2M+4LJovK1lTQ/JOlgG3olKv8tteppxmmFt6HRGOiDPJP/OwR4pd26CP/uTTkhKkGIzrqLWA9/vbAXUy/OkzRrRKPbsKmM26ZFqpwGorLmCep8fZybDCvHCkvftamoroiYnWp1kyoZeqF4/So294i810ZcS5YW6h9Amp4mvPsoZHb06+GQMM8kxztOZQjn89YKk5FAzzKbbM8R7R2ZpIrN2nCes1BEVx1Z3xPSlE6I9IocnXy68lzqlkVn6PanfBkLzb3179C/VXI72rPFO7f0TggcLIFlksh0ywJ0a9VxNTvMjFTHyZDI59PlbMnyvxniBoP9Gca/pg/M6xz3/i7njLVlxtr/aJ2rFNKH5CjW1NbUcVQ26hlPWrPFfgyN/1JXESNlXD1mlfVxeKw0s2bPZ7AxUqDXQDaaSearwbJ9nWyCXqFwlTrNeSBRcHlo1h6yT089vQoy11SF0KWT1I89aMlshWVE3Ic8Zaq96VqqHfnC059A9DQP6cpofGwVOq4WykjQvVbZkny8BNqYntiQIJWd37rGmKEfiUNLHJVi2Fvczy/Qc+UOq4bW6l2RaOkDHSUO9zN0F+DwSo3V+I7RKSKTUHw7iwJozhGQRJc1MS1qCBMvp9aJr5FSgsw6zXTmj9O9w2jhN+dJwC6yzxTa0uED3ri1ChZML2WTXm9JIDqz5xvpjDbUeGZB1DC8P4vSiMNLhgKVHJqs9q5rtLrXbOm3AthrVx6UmWDQQUh1Elzi770sPndbehD6kbhaTfB94XQ4ALBuyvpJa2F5q9sXQaX2Zb/x8PHTa+LF7X1KHTuvLfOPn498AiO7PNNx85rYAAAAASUVORK5CYII=\" width=\"54.5\" height=\"18\" style=\"width: 54.5px; height: 18px;\"\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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = pp1()\r\n  y = [m,n,p];\r\nend","test_suite":"%%\r\ny = pp1();\r\nassert(all(y\u003e0));\r\nassert( isequal(y(1)^2+y(2)^2,13*y(3)) );\r\nyy1 = num2str(y(1));\r\nassert( all(yy1==fliplr(yy1)) )\r\nyy2 = num2str(y(2));\r\nassert( all(yy2==fliplr(yy2)) )\r\nyy3 = num2str(y(3));\r\nassert( all(yy3==fliplr(yy3)) )\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":3,"created_by":2197980,"edited_by":2197980,"edited_at":"2022-04-20T06:54:09.000Z","deleted_by":null,"deleted_at":null,"solvers_count":15,"test_suite_updated_at":"2022-04-20T06:54:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2022-04-14T03:21:34.000Z","updated_at":"2026-04-20T11:26:34.000Z","published_at":"2022-04-14T03:21:34.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eContinued Problem 50033: A palindrome \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e is one-thirteenth of the sum of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en^2\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e, where \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e and \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e are also palindrome. Give an example of \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:customXml w:element=\\\"equation\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"displayStyle\\\" w:val=\\\"false\\\"/\u003e\u003c/w:customXmlPr\u003e\u003cw:r\u003e\u003cw:t\u003e(m,n,p)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:customXml\u003e\u003cw:r\u003e\u003cw:t\u003e. \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\"}]}"},{"id":44421,"title":"Portfolio diversification: choose your stocks !","description":"we have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example:\r\nstock1=[0.1 0.3 0.22 -.15 ] ;\r\nstock2=[0.3 0.4 -0.13 -0.22 ];\r\nstock3=[0.6 -0.3 0.44 0.05];\r\nSo portfolio ={'stock2' 'stock3'} because they are less correlated than any other combination.","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 144.3px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 72.15px; transform-origin: 407px 72.15px; vertical-align: baseline; \"\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; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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; perspective-origin: 360px 8px; transform-origin: 360px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ewe have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 30.65px; transform-origin: 404px 30.65px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 116px 8.5px; tab-size: 4; transform-origin: 116px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estock1=[0.1 0.3 0.22 -.15 ] ;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 120px 8.5px; tab-size: 4; transform-origin: 120px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estock2=[0.3 0.4 -0.13 -0.22 ];\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 112px 8.5px; tab-size: 4; transform-origin: 112px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003estock3=[0.6 -0.3 0.44 0.05];\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 291.5px 8px; transform-origin: 291.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eSo portfolio ={'stock2' 'stock3'} because they are less correlated than any other combination.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function portfolio = your_fcn_name(stock1,stock2,stock3)\r\n  %portfolio = ?\r\nend","test_suite":"%%test 1\r\nstock1=[0.1 0.3 0.22 -.15 ] ;\r\nstock2=[0.3 0.4 -0.13 -0.22 ];\r\nstock3=[0.6 -0.3 0.44 0.05];\r\ny_correct ={'stock2' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 2\r\nstock1=[-0.1 0.4 -0.14 -.32 ];\r\nstock2=[0.35 -0.10 0.66 0.18 ];\r\nstock3=[0.62 -0.3 0.44 0.05];\r\ny_correct = {'stock1' 'stock2'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 3\r\nstock1=[0.3 0.4 -0.8 0.5 ];\r\nstock2=[0.62 0.2 -0.3 0.05];\r\nstock3=[0.35 -0.10 0.66 0.18 ];\r\ny_correct = {'stock1' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 4\r\nstock1=[-0.5 -0.2 0.35 0.02 ];\r\nstock2=[0.2 0.15 -0.3 0.13];\r\nstock3=[0.45 -0.04 0.66 0.2 ];\r\ny_correct = {'stock1' 'stock2'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 5\r\nstock1=[0.5 0.2 0.35 0.4 ];\r\nstock2=[-0.2 -0.15 -0.3 0.13];\r\nstock3=[-0.45 -0.04 0.33 0.15 ];\r\ny_correct = {'stock1' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))\r\n%%test 6\r\nstock1=[-0.32 -0.2 0.35 -0.4 ];\r\nstock2=[0.2 0.15 0.3 0.13];\r\nstock3=[-0.45 -0.04 -0.33 0.15 ];\r\ny_correct = {'stock2' 'stock3'}\r\nassert(isequal(your_fcn_name(stock1,stock2,stock3),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":4,"created_by":156466,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2017-12-02T11:03:36.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-11-30T14:58:55.000Z","updated_at":"2026-03-23T18:16:52.000Z","published_at":"2017-11-30T14:58:55.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\u003ewe have the returns of 3 stocks for the last 4 years and we have to combine only 2 stocks that are less correlated. Example:\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[stock1=[0.1 0.3 0.22 -.15 ] ;\\nstock2=[0.3 0.4 -0.13 -0.22 ];\\nstock3=[0.6 -0.3 0.44 0.05];]]\u003e\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\u003eSo portfolio ={'stock2' 'stock3'} because they are less correlated than any other combination.\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\"}]}"},{"id":58728,"title":"Add Odd and Subtract Even Numbers in an Array","description":"For an input array, add all the odd values and subtract the even values. The final value is the output.\r\nE.g.\r\ninput = [1 2 3 4 5]\r\noutput = 3","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 111px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 55.5px; transform-origin: 407px 55.5px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eFor an input array, add all the odd values and subtract the even values. The final value is the output.\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eE.g.\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003einput = [1 2 3 4 5]\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eoutput = 3\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3 4 5];\r\ny_correct = 3;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 2 4 5];\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 2 4 5 6];\r\ny_correct = -6;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [2 4 5 7];\r\ny_correct = 6;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [1 2 4];\r\ny_correct = -5;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":3469783,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2023-07-18T17:52:35.000Z","updated_at":"2026-04-07T08:41:52.000Z","published_at":"2023-07-18T17:52:35.000Z","restored_at":null,"restored_by":null,"spam":null,"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\u003eFor an input array, add all the odd values and subtract the even values. The final value is the output.\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\u003eE.g.\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\u003einput = [1 2 3 4 5]\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\u003eoutput = 3\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\"}]}"},{"id":50292,"title":"Number Puzzle - 054","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGive an example of an integer y whose square has the form of 5_4_3_2_1 where \"_\" represents a single digit number.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = puzzle_054()\r\n  y = 54321;\r\nend","test_suite":"%%\r\ny=puzzle_054();\r\nassert(y==floor(y))\r\na=num2str(y^2,20);\r\nitest=[5 4 3 2 1];\r\nflag=true;\r\nfor i=1:5\r\n    if num2str(itest(i))~=a(2*i-1)\r\n        flag=false;\r\n    end\r\nend\r\nassert(flag)\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":31,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2021-02-13T22:15:09.000Z","updated_at":"2026-04-17T15:43:57.000Z","published_at":"2021-02-13T22:15:09.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\u003eGive an example of an integer y whose square has the form of 5_4_3_2_1 where \\\"_\\\" represents a single digit number.\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\"}]}"},{"id":45882,"title":"Matrix indexing with two vectors of indices  (★★)","description":"(copy of Prob 589)\r\n\r\nGiven a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)).\r\nThus, if\r\n\r\n  a = [ 1 2 5 ]\r\n  b = [ 4 5 2 ]\r\n  \r\n  M = [   17   24    1    8   15;\r\n          23    5    7   14   16;\r\n           4    6   13   20   22;\r\n          10   12   19   21    3;\r\n          11   18   25    2    9 ]\r\n\r\nthen \r\n\r\n  x = [ M(1,4) M(2,5) M(5,2) ]\r\n  x = [ 8 16 18 ]\r\n","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 337.333px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 168.667px; transform-origin: 407px 168.667px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 57.4583px 10.5px; transform-origin: 57.4583px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e(copy of Prob 589)\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 314.7px 10.5px; transform-origin: 314.7px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 163.467px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 81.7333px; transform-origin: 404px 81.7333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 54.8167px 8.5px; transform-origin: 54.8167px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ea = [ 1 2 5 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 54.8167px 8.5px; transform-origin: 54.8167px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eb = [ 4 5 2 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 0px 8.5px; transform-origin: 0px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003eM = [   17   24    1    8   15;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        23    5    7   14   16;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e         4    6   13   20   22;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 130.717px 8.5px; transform-origin: 130.717px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        10   12   19   21    3;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 134.933px 8.5px; transform-origin: 134.933px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e        11   18   25    2    9 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 13.5833px 10.5px; transform-origin: 13.5833px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ethen\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 40.8667px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 20.4333px; transform-origin: 404px 20.4333px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 118.067px 8.5px; transform-origin: 118.067px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ex = [ M(1,4) M(2,5) M(5,2) ]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4333px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; 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; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; perspective-origin: 404px 10.2167px; transform-origin: 404px 10.2167px; white-space: nowrap; \"\u003e\u003cspan style=\"block-size: auto; border-inline-end-color: rgb(0, 0, 0); border-inline-end-style: none; border-inline-end-width: 0px; border-inline-start-color: rgb(0, 0, 0); border-inline-start-style: none; border-inline-start-width: 0px; border-left-color: rgb(0, 0, 0); border-left-style: none; border-left-width: 0px; border-right-color: rgb(0, 0, 0); border-right-style: none; border-right-width: 0px; display: inline; margin-inline-end: 45px; margin-right: 45px; min-block-size: 0px; min-height: 0px; padding-inline-start: 0px; padding-left: 0px; perspective-origin: 63.25px 8.5px; transform-origin: 63.25px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003ex = [ 8 16 18 ]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 10px; 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; perspective-origin: 84.4167px 10.5px; transform-origin: 84.4167px 10.5px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eAvoid using for/while loops.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function v = twoIndex(M,a,b)\r\n  v = M;\r\nend","test_suite":"%%\r\nM = rand(4);\r\na = [4 3 2 1];\r\nb = [1 2 3 4];\r\nv_correct = M([4 7 10 13]);\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nM = rand(4);\r\na = [3 3 1 3];\r\nb = [1 1 3 1];\r\nv_correct = M([3 3 9 3]);\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nM = rand(100);\r\n[a,b] = size(M);\r\nv_correct = M(end);\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nM = rand(100);\r\na = [];\r\nb = [];\r\nassert(isempty(twoIndex(M,a,b)))\t\r\n%%\r\nM = 1;\r\na = [1 1 1 1 1];\r\nb = [1 1 1 1 1];\r\nv_correct = [1 1 1 1 1];\r\nassert(isequal(twoIndex(M,a,b),v_correct))\r\n%%\r\nfiletext = fileread('twoIndex.m');\r\nassert(isempty(strfind(filetext, 'for')),'for forbidden')\r\nassert(isempty(strfind(filetext, 'while')),'while forbidden')\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":428668,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":43,"test_suite_updated_at":"2020-10-17T01:03:06.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-06-10T20:03:57.000Z","updated_at":"2026-04-26T22:44:08.000Z","published_at":"2020-06-10T20:03:57.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\u003e(copy of Prob 589)\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\u003eGiven a matrix M and two index vectors a and b, return a row vector x where x(i) = M(a(i),b(i)). Thus, if\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[a = [ 1 2 5 ]\\nb = [ 4 5 2 ]\\n\\nM = [   17   24    1    8   15;\\n        23    5    7   14   16;\\n         4    6   13   20   22;\\n        10   12   19   21    3;\\n        11   18   25    2    9 ]]]\u003e\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\u003ethen\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[x = [ M(1,4) M(2,5) M(5,2) ]\\nx = [ 8 16 18 ]]]\u003e\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\u003eAvoid using for/while loops.\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\"}]}"},{"id":42484,"title":"Repeat string n times - 2","description":"This is the two variable version of \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42482-repeat-string-n-times Repeat string n times\u003e.\r\n\r\n* you will have a string (s = 'str_')\r\n* a starting point (num1 = 4)\r\n* another starting point (num2 = 10)\r\n* a n (n = 4)\r\n\r\n output=\r\n  {'str_4_10'\r\n   'str_5_11'\r\n   'str_6_12'\r\n   'str_7_13'}","description_html":"\u003cp\u003eThis is the two variable version of \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42482-repeat-string-n-times\"\u003eRepeat string n times\u003c/a\u003e.\u003c/p\u003e\u003cul\u003e\u003cli\u003eyou will have a string (s = 'str_')\u003c/li\u003e\u003cli\u003ea starting point (num1 = 4)\u003c/li\u003e\u003cli\u003eanother starting point (num2 = 10)\u003c/li\u003e\u003cli\u003ea n (n = 4)\u003c/li\u003e\u003c/ul\u003e\u003cpre\u003e output=\r\n  {'str_4_10'\r\n   'str_5_11'\r\n   'str_6_12'\r\n   'str_7_13'}\u003c/pre\u003e","function_template":"function y = rep_str_2(str, num1, num2, n)\r\n  y = x;\r\nend","test_suite":"%%\r\nfiletext = fileread('rep_str_2.m');\r\nassert(isempty(strfind(filetext, 'for')))\r\nassert(isempty(strfind(filetext, 'while')))\r\n\r\n%%\r\nx = 'str_';\r\nnum1 = 4;\r\nnum2 = 10;\r\nn = 4;\r\ny_correct = {'str_4_10'\r\n'str_5_11'\r\n'str_6_12'\r\n'str_7_13'};\r\nassert(isequal(rep_str_2(x, num1, num2, n),y_correct))\r\n\r\n%%\r\nx = 'matstr_';\r\nnum1 = 0;\r\nnum2 = 50;\r\nn = 3;\r\ny_correct = {'matstr_0_50'\r\n'matstr_1_51'\r\n'matstr_2_52'};\r\nassert(isequal(rep_str_2(x, num1, num2, n),y_correct))\r\n\r\n%%\r\nx = 'matstr2_';\r\nnum1 = 2;\r\nnum2 = 3;\r\nn = 1;\r\ny_correct = {'matstr2_2_3'};\r\nassert(isequal(rep_str_2(x, num1, num2, n),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":1,"created_by":8703,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":33,"test_suite_updated_at":"2015-08-02T08:48:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-08-02T08:40:19.000Z","updated_at":"2026-05-01T11:32:45.000Z","published_at":"2015-08-02T08:48:37.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the two variable version of\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/problems/42482-repeat-string-n-times\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eRepeat string n times\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\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 will have a string (s = 'str_')\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\u003ea starting point (num1 = 4)\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\u003eanother starting point (num2 = 10)\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\u003ea n (n = 4)\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[ output=\\n  {'str_4_10'\\n   'str_5_11'\\n   'str_6_12'\\n   'str_7_13'}]]\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\"}]}"},{"id":42793,"title":"Fast 1-D Convolution (full shape)","description":"This is the first problem in the \u003chttp://www.mathworks.com/matlabcentral/cody/?term=Fast+1-D+Convolution fast 1-D convolution series\u003e. This problem asks you to find a fast algorithm to compute the 1-D convolution in its full output shape.  \r\n\r\nThere exists a fast 1-D convolution algorithm way more efficient than MATLAB's built-in *conv* function invoked in the form *conv(u,v,'full')*, and the performance improvement is more pronounced when length(u) and/or length(v) are large. Do you know how? Try it out. \r\n\r\n* Next problem: \u003chttp://www.mathworks.com/matlabcentral/cody/problems/42794-fast-1-d-convolution-same-shape Fast 1-D Convolution (same shape)\u003e.","description_html":"\u003cp\u003eThis is the first problem in the \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/?term=Fast+1-D+Convolution\"\u003efast 1-D convolution series\u003c/a\u003e. This problem asks you to find a fast algorithm to compute the 1-D convolution in its full output shape.\u003c/p\u003e\u003cp\u003eThere exists a fast 1-D convolution algorithm way more efficient than MATLAB's built-in \u003cb\u003econv\u003c/b\u003e function invoked in the form \u003cb\u003econv(u,v,'full')\u003c/b\u003e, and the performance improvement is more pronounced when length(u) and/or length(v) are large. Do you know how? Try it out.\u003c/p\u003e\u003cul\u003e\u003cli\u003eNext problem: \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/42794-fast-1-d-convolution-same-shape\"\u003eFast 1-D Convolution (same shape)\u003c/a\u003e.\u003c/li\u003e\u003c/ul\u003e","function_template":"function y = fconv1f(u,v)\r\n  y = conv(u,v,'full');   % Extremely inefficient solution!\r\nend","test_suite":"%%\r\n%{\r\n╔═════════════════════════════════════════════════════════════╗\r\n║ Please note that problems in this series are designed for   ║\r\n║ optimizing the code performance, rather than the usual Cody ║\r\n║ \"size\". We are achieving this goal by courtesy of LY Cao's  ║ \r\n║ new scoring function, which automatically grants a better   ║\r\n║ score to a faster solution. Kindly note that simply using   ║\r\n║ the conv function may result in a poor score or even failure║\r\n║ in one of the tests. Suggestions and comments are welcome.  ║\r\n║                                                             ║\r\n║ Thanks \u0026 have fun!                                          ║\r\n║ Peng                                                        ║\r\n╚═════════════════════════════════════════════════════════════╝\r\n%}\r\n\r\n%%\r\nfid = fopen('EvaluateSolution.p','wb'); \r\nfwrite(fid,uint8(sscanf('7630312E30307630302E30300005B01CF7473FB1000000B50000010D000001A93014D309F9979F2A2C808C4F104ACA1480D0378FBCF4FF1C4C94A38C84A4969D0A597F5F12C8D564E7CD9584DF8BDD849A3B8C5FDEB66A3837A064275728B38736860BB79ABC4B3091D37C9A2010BE0378E708E59716738F85AA4AEBC8982C45E6CD45BAD19BD043D16D5834122D405752633CE6BD78ABA0676336E7BCDD4F2E181FF1CE8E9165F6BF30D850ED74385A40BDEB73AD82518B4CF2BB034951B1D23D360EDF335C22C209AAB3857BCEF61D192170FDE9D5449721A6B6DD082257E430059753696F1C5CD66E6B09AD24270B0335E830203EACA5BDF3E2A57620D5DB44A96AFCDE0387EF112F2A83FBF90E4AF09F9D4FCAA22134055610D0F7B55568D50A52CD5C46A3F0CA655C1B68','%2x')));\r\nfclose(fid);\r\n\r\n%%\r\nu = 1; v = 1;\r\ny_correct = 1;\r\nassert(isequal(fconv1f(u,v),y_correct))\r\n\r\n%%\r\nu = 1:10; v = 1:5;\r\ny_correct = [1,4,10,20,35,50,65,80,95,110,114,106,85,50];\r\nassert(all(abs(fconv1f(u,v)-y_correct)\u003c1e-10))\r\n\r\n%%\r\nu = [2 -4 0 1].'; v = [1:5].';\r\ny_correct = [2,0,-2,-3,-4,-17,4,5].';\r\nassert(all(abs(fconv1f(u,v)-y_correct)\u003c1e-10))\r\n\r\n%%\r\nu = rand(20,1); v = rand(10,1);\r\ny_correct = conv(u,v,'full');\r\nassert(all(abs(fconv1f(u,v)-y_correct)\u003c1e-10))\r\n\r\n%%\r\n% Large data size\r\nglobal sol_score\r\nu = rand(8e5,1); v = rand(1e5,1);\r\nt = builtin('tic');\r\ny = fconv1f(u,v);\r\nsol_score = 50*builtin('toc',t);\r\nAbsTol = 1e-6;   % Maximum absolute error tolerance\r\npass = EvaluateSolution(u,v,y,AbsTol);  \r\nassert(pass);\r\n\r\n%%\r\n% New scoring function by LY Cao\r\nglobal sol_score\r\nfid = fopen('score.p','wb');\r\nfwrite(fid,sscanf('7630312E30307630302E30300008501CD77E9FB100000035000001110000018422762999A8C1DE50537BEE443F4D73651F830FC6C78ADFB7DF68DF98823F565884DC58E21C7E397E3D26E4FFEA9A0D83589ABB5C0B0B553B44CFD79C9B272D11DF1965AD538598E8319529727DF4C4CF36A6016DD7816544AE5A8F64C9B2D9D0C4B94DD5EDF14595CBFE3D402647499EA3D9D125AC927454ED85973BCD1AAEA536D5A6CDDCD78A0211E8179603FFE12E4AB0E4704EA195704428700BAE5C4DFD42FF1A8760EDF2721F9724498ECC9F957735E7A3CDB9630DB17DF92ACE8F486706020E0A8D022D14BC313879724760AE20D67F572DD85211E4BEA45CDF3E22976253F113AEA96C1FF907329E4BD429BCFC6331077DA21F05D791DA6ECCF680D2E23AC77DFCE5C1D9869D3098F5B89FF92A','%2x'));\r\nfclose(fid);\r\nscore(sol_score);\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":6,"created_by":12569,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":36,"test_suite_updated_at":"2016-04-04T03:53:09.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-04-02T21:05:59.000Z","updated_at":"2026-05-25T00:53:31.000Z","published_at":"2016-04-03T19:56:23.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is the first problem in the\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/?term=Fast+1-D+Convolution\\\"\u003e\u003cw:r\u003e\u003cw:t\u003efast 1-D convolution series\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This problem asks you to find a fast algorithm to compute the 1-D convolution in its full output shape.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThere exists a fast 1-D convolution algorithm way more efficient than MATLAB's built-in\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econv\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e function invoked in the form\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003econv(u,v,'full')\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e, and the performance improvement is more pronounced when length(u) and/or length(v) are large. Do you know how? Try it out.\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\u003eNext problem:\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/problems/42794-fast-1-d-convolution-same-shape\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eFast 1-D Convolution (same shape)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":1786,"title":"Create an index-powered vector","description":"Given a input vector x, return y as index-powered vector as shown below.\r\n\r\nExample\r\n\r\n x = [2 3 6 9]\r\n\r\nthen y should be \r\n\r\n [2^1 3^2 6^3 9^4] = [2 9 216 6561]\r\n","description_html":"\u003cp\u003eGiven a input vector x, return y as index-powered vector as shown below.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cpre\u003e x = [2 3 6 9]\u003c/pre\u003e\u003cp\u003ethen y should be\u003c/p\u003e\u003cpre\u003e [2^1 3^2 6^3 9^4] = [2 9 216 6561]\u003c/pre\u003e","function_template":"function y = index_power(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [2 3 6 9];\r\ny_correct = [2 9 216 6561];\r\nassert(isequal(index_power(x),y_correct))\r\n\r\n%%\r\nx = [1 5 11 0 -3 -6];\r\ny_correct = [1  25 1331 0 -243 46656];\r\nassert(isequal(index_power(x),y_correct))\r\n\r\n%%\r\nx = [0 8 -12 0 -8 -2];\r\ny_correct = [0 64 -1728 0 -32768 64];\r\nassert(isequal(index_power(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":8,"comments_count":1,"created_by":16381,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":955,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":13,"created_at":"2013-08-12T02:52:55.000Z","updated_at":"2026-05-18T16:12:57.000Z","published_at":"2013-08-12T02:54:18.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a input vector x, return y as index-powered vector as shown below.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample\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[ x = [2 3 6 9]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen y should be\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[ [2^1 3^2 6^3 9^4] = [2 9 216 6561]]]\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\"}]}"},{"id":125,"title":"Remove DC","description":"Input x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.\r\n\r\nExample:\r\n\r\n Input  x = [  1  2  3  2  1  2  3]\r\n Output y = [ -1  0  1  0 -1  0  1]","description_html":"\u003cp\u003eInput x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e Input  x = [  1  2  3  2  1  2  3]\r\n Output y = [ -1  0  1  0 -1  0  1]\u003c/pre\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 0;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = [2 0];\r\ny_correct = [1 -1];\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = 0:100;\r\ny_correct = -50:50;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":451,"test_suite_updated_at":"2012-01-28T01:22:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-28T01:22:32.000Z","updated_at":"2026-04-27T22:55:08.000Z","published_at":"2012-02-03T02:39:08.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInput x is the sampled signal vector, may have both AC and DC components. Output y should not contain any DC component.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[ Input  x = [  1  2  3  2  1  2  3]\\n Output y = [ -1  0  1  0 -1  0  1]]]\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\"}]}"},{"id":49082,"title":"Energy Conversion 1","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 21px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 10.5px; transform-origin: 407px 10.5px; vertical-align: baseline; \"\u003e\u003cdiv style=\"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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 239px 8px; transform-origin: 239px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eGiven an energy in the unit of BTU (British Thermal Unit), convert it to Joule.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = convert_stuff(x)\r\n  y = x+273.15;\r\nend","test_suite":"%%\r\nx = 123;\r\ny_correct = 129772.38;\r\nassert(abs(convert_stuff(x)-y_correct)\u003c1e-4)\r\n\r\n%%\r\nx = 0.015;\r\ny_correct = 15.8259;\r\nassert(abs(convert_stuff(x)-y_correct)\u003c1e-4)\r\n\r\n%%\r\nx = 66.3;\r\ny_correct = 69950.478;\r\nassert(abs(convert_stuff(x)-y_correct)\u003c1e-4)","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":180632,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1062,"test_suite_updated_at":"2021-03-22T11:36:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-12-22T22:07:55.000Z","updated_at":"2026-05-21T15:28:17.000Z","published_at":"2020-12-22T22:07:55.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\u003eGiven an energy in the unit of BTU (British Thermal Unit), convert it to Joule.\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\"}]}"},{"id":120,"title":"radius of a spherical planet","description":"You just measured its surface area, that is the input.","description_html":"\u003cp\u003eYou just measured its surface area, that is the input.\u003c/p\u003e","function_template":"function y = your_fcn_name(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 4*pi;\r\ny_correct = 1;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 400*pi;\r\ny_correct = 10;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n\r\n%%\r\nx = 40000*pi;\r\ny_correct = 100;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n%%\r\nx = -4*pi;\r\ny_correct = 1i;\r\nassert(isequal(your_fcn_name(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":19,"comments_count":9,"created_by":166,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":4500,"test_suite_updated_at":"2012-02-15T16:29:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-27T21:02:01.000Z","updated_at":"2026-05-27T06:55:42.000Z","published_at":"2012-02-15T16:45:42.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou just measured its surface area, that is the input.\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\"}]}"},{"id":47558,"title":"Guess the logic","description":null,"description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 141px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 343px 70.5px; transform-origin: 343px 70.5px; vertical-align: baseline; \"\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGuess the logic and make a function logic(x) which will return y.\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(1) = 0\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(2) = 188\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(4) = 2256\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; perspective-origin: 320px 10.5px; text-align: left; transform-origin: 320px 10.5px; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003elogic(6) = 8460\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = logic(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\ny_correct = 0;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 2;\r\ny_correct = 188;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 4;\r\ny_correct = 2256;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 6;\r\ny_correct = 8460;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 10;\r\ny_correct = 42300;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 15;\r\ny_correct = 148050;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 20;\r\ny_correct = 357200;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 50;\r\ny_correct = 5757500;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 100;\r\ny_correct = 46530000;\r\nassert(isequal(logic(x),y_correct))\r\n%%\r\nx = 243;\r\ny_correct = 671623326;\r\nassert(isequal(logic(x),y_correct))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":737003,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":24,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-11-19T10:01:39.000Z","updated_at":"2026-03-15T18:53:27.000Z","published_at":"2020-11-19T10:17:02.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\u003eGuess the logic and make a function logic(x) which will return y.\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\u003elogic(1) = 0\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\u003elogic(2) = 188\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\u003elogic(4) = 2256\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\u003elogic(6) = 8460\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\"}]}"},{"id":2012,"title":"Tony's trick for duplicating an mx1 vector n times","description":"Without using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n. v can be numeric or character. n may be 0.\r\n\r\nExamples\r\n\r\nIf\r\n\r\n v = 5;\r\n n = 3;\r\n\r\nthen return v1:\r\n\r\n v1 = [5 5 5] \r\n\r\nIf a 2d matrix is supplied then the vector v will be the first column.\r\n\r\n V = magic(4);\r\n n = 4;\r\n\r\nthen v and v1 are returned as shown below.\r\n\r\n v = [16 5 9 4]'\r\n v1 = [16 16 16 16; 5 5 5 5; 9 9 9 9; 4 4 4 4] \r\n\r\nHint: use indexing\r\n","description_html":"\u003cp\u003eWithout using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n. v can be numeric or character. n may be 0.\u003c/p\u003e\u003cp\u003eExamples\u003c/p\u003e\u003cp\u003eIf\u003c/p\u003e\u003cpre\u003e v = 5;\r\n n = 3;\u003c/pre\u003e\u003cp\u003ethen return v1:\u003c/p\u003e\u003cpre\u003e v1 = [5 5 5] \u003c/pre\u003e\u003cp\u003eIf a 2d matrix is supplied then the vector v will be the first column.\u003c/p\u003e\u003cpre\u003e V = magic(4);\r\n n = 4;\u003c/pre\u003e\u003cp\u003ethen v and v1 are returned as shown below.\u003c/p\u003e\u003cpre\u003e v = [16 5 9 4]'\r\n v1 = [16 16 16 16; 5 5 5 5; 9 9 9 9; 4 4 4 4] \u003c/pre\u003e\u003cp\u003eHint: use indexing\u003c/p\u003e","function_template":"function v1 = reproduce_nv(v,n)\r\n  v1 = v;\r\nend","test_suite":"%%\r\nx=magic(3);\r\nn=3;\r\ny_correct=[8 8 8; 3 3 3; 4 4 4];\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n%%\r\nx=magic(10);\r\nn=19;\r\ny_correct=repmat(x(:,1),1,19);\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n%% \r\nx=1;\r\nn=0;\r\ny_correct=linspace(x,x,n); %arbitrary way to get the soln\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n%%\r\nx='1';\r\nn=7;\r\ny_correct=['1' '1' '1' '1' '1' '1' '1'];\r\nassert(isequal(reproduce_nv(x,n),y_correct))\r\n\r\n\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":17471,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-11-23T08:42:47.000Z","updated_at":"2026-04-02T12:30:19.000Z","published_at":"2013-11-23T08:48:28.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eWithout using repmat, or for loop, or concatenation, create a function to duplicate a vector, v, a specified number of times, n. v can be numeric or character. n may be 0.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExamples\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf\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[ v = 5;\\n n = 3;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen return v1:\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[ v1 = [5 5 5]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIf a 2d matrix is supplied then the vector v will be the first column.\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[ V = magic(4);\\n n = 4;]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen v and v1 are returned as shown below.\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[ v = [16 5 9 4]'\\n v1 = [16 16 16 16; 5 5 5 5; 9 9 9 9; 4 4 4 4]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHint: use indexing\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\"}]}"},{"id":42438,"title":"row removal ","description":"Consider a matrix and remove the first row of the matrix.\r\n","description_html":"\u003cp\u003eConsider a matrix and remove the first row of the matrix.\u003c/p\u003e","function_template":"function y = remove_row(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx  = [ 1, 2, 3; 3, 5, 9; 1, 8, 0 ]\r\ny_correct  = [3, 5, 9; 1, 8, 0]\r\nassert(isequal(remove_row(x),y_correct))\r\n\r\n%%\r\nx  = [ 3, 5; 1, 0 ]\r\ny_correct  = [1, 0]\r\nassert(isequal(remove_row(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":2,"created_by":43484,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":407,"test_suite_updated_at":"2015-07-14T21:03:19.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2015-06-29T06:48:13.000Z","updated_at":"2026-05-22T16:25:19.000Z","published_at":"2015-06-29T06:48:13.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eConsider a matrix and remove the first row of the matrix.\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\"}]}"},{"id":640,"title":"Getting logical indexes","description":"This is a basic MATLAB operation.  It is for instructional purposes.\r\n\r\n---\r\n\r\nLogical indexing works like this.\r\n\r\n  thresh = 4;\r\n  vec    = [1 2 3 4 5 6 7 8];\r\n  \r\n  vi     = (vec \u003e thresh)\r\n  \r\n  vi =\r\n  \r\n       0     0     0     0     1     1     1     1\r\n\r\nOnce you have this TRUE FALSE vector (I call it vi: Valid Indices)\r\n\r\nIt can be used to get the values out:\r\n\r\n  big = vec(vi)\r\n  \r\n  big =\r\n  \r\n       5     6     7     8\r\n\r\nGiven a vector, vec, and a value, v, return a binary vector that represents the indices where vector, vec, is equal to scalar, v.\r\n\r\nNote, this works just as well with scalars and matrices.\r\n\r\n----\r\n\r\nTo get the indices where this comparison is true, see this \u003chttp://www.mathworks.com/matlabcentral/cody/problems/645-getting-the-indices-from-a-vector Cody problem\u003e.","description_html":"\u003cp\u003eThis is a basic MATLAB operation.  It is for instructional purposes.\u003c/p\u003e\u003cp\u003e---\u003c/p\u003e\u003cp\u003eLogical indexing works like this.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ethresh = 4;\r\nvec    = [1 2 3 4 5 6 7 8];\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003evi     = (vec \u003e thresh)\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003evi =\r\n\u003c/pre\u003e\u003cpre\u003e       0     0     0     0     1     1     1     1\u003c/pre\u003e\u003cp\u003eOnce you have this TRUE FALSE vector (I call it vi: Valid Indices)\u003c/p\u003e\u003cp\u003eIt can be used to get the values out:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ebig = vec(vi)\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003ebig =\r\n\u003c/pre\u003e\u003cpre\u003e       5     6     7     8\u003c/pre\u003e\u003cp\u003eGiven a vector, vec, and a value, v, return a binary vector that represents the indices where vector, vec, is equal to scalar, v.\u003c/p\u003e\u003cp\u003eNote, this works just as well with scalars and matrices.\u003c/p\u003e\u003cp\u003e----\u003c/p\u003e\u003cp\u003eTo get the indices where this comparison is true, see this \u003ca href=\"http://www.mathworks.com/matlabcentral/cody/problems/645-getting-the-indices-from-a-vector\"\u003eCody problem\u003c/a\u003e.\u003c/p\u003e","function_template":"function vi = binaryEqualsVector(vec, v)\r\n  vi = true;\r\nend","test_suite":"%%\r\nvec = [1 2 3 3 2 1];\r\nv = 2;\r\ny_correct = [false true false false true false];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n\r\n%%\r\nvec = [1 2 3 4 5 6];\r\nv = 0;\r\ny_correct = [false false false false false false];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n\r\n%%\r\nvec = [1 1 1 1 1];\r\nv = 1;\r\ny_correct = [true true true true true];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n\r\n%%\r\nvec = 'abcdef';\r\nv = 'a';\r\ny_correct = [true false false false false false];\r\nassert(isequal(binaryEqualsVector(vec,v),y_correct))\r\n","published":true,"deleted":false,"likes_count":9,"comments_count":0,"created_by":240,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1188,"test_suite_updated_at":"2012-04-30T18:48:13.000Z","rescore_all_solutions":false,"group_id":12,"created_at":"2012-04-30T18:46:03.000Z","updated_at":"2026-05-02T11:20:39.000Z","published_at":"2012-04-30T18:48:13.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is a basic MATLAB operation. It is for instructional purposes.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e---\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eLogical indexing works like this.\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[thresh = 4;\\nvec    = [1 2 3 4 5 6 7 8];\\n\\nvi     = (vec \u003e thresh)\\n\\nvi =\\n\\n       0     0     0     0     1     1     1     1]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOnce you have this TRUE FALSE vector (I call it vi: Valid Indices)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIt can be used to get the values out:\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[big = vec(vi)\\n\\nbig =\\n\\n       5     6     7     8]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a vector, vec, and a value, v, return a binary vector that represents the indices where vector, vec, is equal to scalar, v.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNote, this works just as well with scalars and matrices.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e----\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTo get the indices where this comparison is true, see this\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/problems/645-getting-the-indices-from-a-vector\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eCody problem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":42917,"title":"Nth roots of unity","description":"First, find the n nth roots of unity.\r\neg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Root_of_unity\u003e\r\n\r\nSecond, raise each root to the power pi (.^pi).\r\n\r\nThird, sum the resulting numbers and use that as the output. \r\n","description_html":"\u003cp\u003eFirst, find the n nth roots of unity.\r\neg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Root_of_unity\"\u003ehttps://en.wikipedia.org/wiki/Root_of_unity\u003c/a\u003e\u003c/p\u003e\u003cp\u003eSecond, raise each root to the power pi (.^pi).\u003c/p\u003e\u003cp\u003eThird, sum the resulting numbers and use that as the output.\u003c/p\u003e","function_template":"function y = your_fcn_name(n)\r\n  y = 0;\r\nend","test_suite":"%%\r\nn = 5;\r\ny_correct =  -0.467800202134647;\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n\r\n%%\r\nn = 50;\r\ny_correct = -2.151544927902936 - 0.430301217000093i\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n\r\n%%\r\nn = 7;\r\ny_correct =   -0.435928596902380\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n\r\n\r\n%%\r\nn = 70;\r\ny_correct =   -3.031653804728051 - 0.430301217000095i\r\nassert( abs(your_fcn_name(n)-y_correct) \u003c .0001)\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":65480,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":67,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-08-01T00:25:42.000Z","updated_at":"2026-02-24T14:03:00.000Z","published_at":"2016-08-01T00:25:42.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFirst, find the n nth roots of unity. eg if n = 6, find the n distinct (complex) numbers such that n^6 = 1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Root_of_unity\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Root_of_unity\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026gt;\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSecond, raise each root to the power pi (.^pi).\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThird, sum the resulting numbers and use that as the output.\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\"}]}"},{"id":45177,"title":"Summing Rows and Columns","description":"Create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.\r\n\r\nFor example\r\n\r\n   x = [ 1  2  3\r\n         4  5  6\r\n         7  8  9 ]\r\n\r\nthen\r\n\r\n   y = [ 1  2  3  6 \r\n         4  5  6 15\r\n         7  8  9 24\r\n        12 15 18 45 ]\r\n","description_html":"\u003cp\u003eCreate a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.\u003c/p\u003e\u003cp\u003eFor example\u003c/p\u003e\u003cpre\u003e   x = [ 1  2  3\r\n         4  5  6\r\n         7  8  9 ]\u003c/pre\u003e\u003cp\u003ethen\u003c/p\u003e\u003cpre\u003e   y = [ 1  2  3  6 \r\n         4  5  6 15\r\n         7  8  9 24\r\n        12 15 18 45 ]\u003c/pre\u003e","function_template":"function y = mat_man(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [1 2 3;4 5 6;7 8 9];\r\ny_correct = [1 2 3 6; 4 5 6 15; 7 8 9 24; 12 15 18 45];\r\nassert(isequal(mat_man(x),y_correct))\r\n\r\n%%\r\nx=[1,2;3,4;5,6];\r\ny_correct =[1 2 3; 3 4 7;5 6 11;9 12 21];\r\nassert(isequal(mat_man(x),y_correct))\r\n     \r\n     \r\n     \r\n     ","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":60,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-10-17T17:04:42.000Z","updated_at":"2026-04-08T18:09:47.000Z","published_at":"2019-10-17T17:18:55.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCreate a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example\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[   x = [ 1  2  3\\n         4  5  6\\n         7  8  9 ]]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ethen\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[   y = [ 1  2  3  6 \\n         4  5  6 15\\n         7  8  9 24\\n        12 15 18 45 ]]]\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\"}]}"},{"id":43564,"title":"Calculate sin(x) without sin(x)","description":"Calculate\r\ny = sin(x)\r\n\r\nx = 0 -\u003e y= 0\r\n\r\nwithout the use of sin(x) or cos(x)\r\n","description_html":"\u003cp\u003eCalculate\r\ny = sin(x)\u003c/p\u003e\u003cp\u003ex = 0 -\u0026gt; y= 0\u003c/p\u003e\u003cp\u003ewithout the use of sin(x) or cos(x)\u003c/p\u003e","function_template":"function y = my_func(x)\r\n  y = sin(x);\r\nend","test_suite":"x = 0;\r\ny_correct = 0;\r\nassert(abs(my_func(x)-y_correct)\u003c0.0001)\r\n\r\n%%\r\nx = -pi/2;\r\ny_correct = sin(x);\r\nassert(abs(my_func(x)-y_correct)\u003c0.0001)\r\n\r\n%%\r\nx = rand(1)*2*pi;\r\ny_correct = sin(x);\r\nassert(abs(my_func(x)-y_correct)\u003c0.0001)\r\n\r\n%%\r\nassessFunctionAbsence({'cos', 'sin'}, 'FileName', 'my_func.m');\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":2,"created_by":14644,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":119,"test_suite_updated_at":"2016-12-01T18:41:33.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-16T10:50:54.000Z","updated_at":"2026-04-24T08:33:53.000Z","published_at":"2016-10-16T10:50:54.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eCalculate y = sin(x)\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\u003ex = 0 -\u0026gt; y= 0\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\u003ewithout the use of sin(x) or cos(x)\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\"}]}"},{"id":2362,"title":"What day is it?","description":"Tell me what day is it. Return the full name of the day of the week as a string.\r\n\r\ne.g. It's June 12th 2014, so your function should return 'Thursday'","description_html":"\u003cp\u003eTell me what day is it. Return the full name of the day of the week as a string.\u003c/p\u003e\u003cp\u003ee.g. It's June 12th 2014, so your function should return 'Thursday'\u003c/p\u003e","function_template":"function y = day_of_week()\r\ny = 'Friday';\r\nend","test_suite":"%%\r\ntoday = java.util.Date;\r\nc = java.util.Calendar.getInstance();\r\nc.setTime( today );\r\ndayOfWeek = c.get(java.util.Calendar.DAY_OF_WEEK);\r\nswitch dayOfWeek\r\n    case 1\r\n        dayOfWeek = 'Sunday';    \r\n    case 2\r\n        dayOfWeek = 'Monday';\r\n    case 3\r\n        dayOfWeek = 'Tuesday';\r\n    case 4\r\n        dayOfWeek = 'Wednesday';\r\n    case 5\r\n        dayOfWeek = 'Thursday';\r\n    case 6\r\n        dayOfWeek = 'Friday';\r\n    case 7\r\n        dayOfWeek = 'Saturday';\r\nend\r\nassert(strcmp(dayOfWeek,day_of_week()))","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":450,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":222,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-06-12T20:06:06.000Z","updated_at":"2026-03-12T20:06:11.000Z","published_at":"2014-06-13T14:20:59.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eTell me what day is it. Return the full name of the day of the week as a string.\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\u003ee.g. It's June 12th 2014, so your function should return 'Thursday'\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\"}]}"},{"id":2051,"title":"is the number happy?","description":"test is a given integer number is Happy of not?\r\nanswer 1 if yes or 0 is no","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.4333px; 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: 400; text-decoration: rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 51px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 25.5px; transform-origin: 407px 25.5px; vertical-align: baseline; \"\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 146.5px 8px; transform-origin: 146.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003etest is a given integer number is Happy of not?\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; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; 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; perspective-origin: 78.5px 8px; transform-origin: 78.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eanswer 1 if yes or 0 is no\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function tf = ishappy(n)\r\n  tf='?';\r\nend","test_suite":"%%\r\nn = 10;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 1;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),n))\r\n%%\r\nn = 2;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),rem(n,2)))\r\n%%\r\nn = 31;\r\nassert(isequal(ishappy(n),rem(n,2)))\r\n%%\r\nn = 13;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 11;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 47;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 101;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 100;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 130;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 230;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 190;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 290;\r\ny_correct = 0;\r\nassert(isequal(ishappy(n),y_correct))\r\n%%\r\nn = 998;\r\ny_correct = 1;\r\nassert(isequal(ishappy(n),y_correct))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":1,"created_by":17471,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":77,"test_suite_updated_at":"2022-02-07T06:56:32.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-12-15T04:37:05.000Z","updated_at":"2026-01-09T18:26:15.000Z","published_at":"2013-12-15T05:19:36.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\u003etest is a given integer number is Happy of not?\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\u003eanswer 1 if yes or 0 is no\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\"}]}"},{"id":2120,"title":"Rounding off numbers to n decimals","description":"Inspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point number to n decimals. There are 2 inputs to the function: x: floating point number and n: number of decimals which need to match with the given solutions.","description_html":"\u003cp\u003eInspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point number to n decimals. There are 2 inputs to the function: x: floating point number and n: number of decimals which need to match with the given solutions.\u003c/p\u003e","function_template":"function y = myround(x,n)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = 1;\r\nn=1;\r\ny_correct = 1;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = pi;\r\nn=5;\r\ny_correct = 3.14159;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = 0.5*sqrt(2);\r\nn=6;\r\ny_correct = 0.707107;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = exp(1);\r\nn=9;\r\ny_correct = 2.718281828;\r\nassert(isequal(myround(x,n),y_correct))\r\n%%\r\nx = 0.00123456;\r\nn=6;\r\ny_correct = 0.001235;\r\nassert(isequal(myround(x,n),y_correct))\r\n","published":true,"deleted":false,"likes_count":24,"comments_count":3,"created_by":20079,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5730,"test_suite_updated_at":"2014-01-15T04:17:27.000Z","rescore_all_solutions":false,"group_id":38,"created_at":"2014-01-15T04:03:48.000Z","updated_at":"2026-05-27T12:21:47.000Z","published_at":"2014-01-15T04:14:20.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\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"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\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInspired by a mistake in one of the problems I created, I created this problem where you have to round off a floating point number to n decimals. There are 2 inputs to the function: x: floating point number and n: number of decimals which need to match with the given solutions.\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\"}]}"},{"id":1985,"title":"How unique?","description":"Sometimes, when we check unique entries of vector we would like to know how many times each value occurs.\r\n\r\nGiven vector of numbers *A* return vector *U* of unique values of A and corresponding vector *H* with occurrences.\r\n\r\nExample:\r\n\r\n   in:  A = [2 2 2 3 3 2 3 8 6 5 6]\r\n  out:  U = [2 3 8 6 5]\r\n        H = [4 3 1 2 1]  ","description_html":"\u003cp\u003eSometimes, when we check unique entries of vector we would like to know how many times each value occurs.\u003c/p\u003e\u003cp\u003eGiven vector of numbers \u003cb\u003eA\u003c/b\u003e return vector \u003cb\u003eU\u003c/b\u003e of unique values of A and corresponding vector \u003cb\u003eH\u003c/b\u003e with occurrences.\u003c/p\u003e\u003cp\u003eExample:\u003c/p\u003e\u003cpre\u003e   in:  A = [2 2 2 3 3 2 3 8 6 5 6]\r\n  out:  U = [2 3 8 6 5]\r\n        H = [4 3 1 2 1]  \u003c/pre\u003e","function_template":"function [U,H] = hunique(A)\r\n  U = 1:5;\r\n  H = ones(1,5);\r\nend","test_suite":"%%\r\nA = [2 2 2 3 3 2 3 8 6 5 6];\r\n[U, H] = hunique(A);\r\nU_ok = [2 3 8 6 5];\r\nH_ok = [4 3 1 2 1];\r\nassert(isequal(U,U_ok));\r\nassert(isequal(H,H_ok));\r\n%%\r\nA = [2 2 2 3 3 2 3 8 6 5 6 8];\r\n[U, H] = hunique(A);\r\nU_ok = [2 3 8 6 5];\r\nH_ok = [4 3 2 2 1];\r\nassert(isequal(U,U_ok));\r\nassert(isequal(H,H_ok));\r\n%%\r\nA = 100:-11:1;\r\nassert(isequal(hunique(A),A));\r\n[~,H] = hunique(A);\r\nassert(isequal(H,ones(1,10)));\r\n%%\r\nA = randi([-10 10],1,100);\r\n[U,H] = hunique(A);\r\nassert(sum(H)==numel(A));\r\nassert(isequal(unique(A),sort(U)));\r\n\r\n% number of test cases may increace in the future.\r\n% any proposals of test cases warmly welcome.","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":14358,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":140,"test_suite_updated_at":"2014-04-06T18:52:22.000Z","rescore_all_solutions":false,"group_id":21,"created_at":"2013-11-12T23:00:10.000Z","updated_at":"2026-05-05T20:00:31.000Z","published_at":"2013-11-13T23:40:01.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSometimes, when we check unique entries of vector we would like to know how many times each value occurs.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven vector of numbers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e return vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eU\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of unique values of A and corresponding vector\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eH\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with occurrences.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\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[   in:  A = [2 2 2 3 3 2 3 8 6 5 6]\\n  out:  U = [2 3 8 6 5]\\n        H = [4 3 1 2 1]]]\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\"}]}"},{"id":45446,"title":"Create logarithmically spaced values (★)","description":"Given three numbers a,b,n with b\u003ea, create a vector y with n logarithmic spaced values between 10^a and 10^b.\r\nThus, if a = -2, b = 3 and n = 6, then \r\n\r\n  y = [10^-2 10^-1 10^0 10^1 10^2 10^3] = [0.01 0.1 1.0 10.0 100.0 1000.0]  ","description_html":"\u003cp\u003eGiven three numbers a,b,n with b\u0026gt;a, create a vector y with n logarithmic spaced values between 10^a and 10^b.\r\nThus, if a = -2, b = 3 and n = 6, then\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003ey = [10^-2 10^-1 10^0 10^1 10^2 10^3] = [0.01 0.1 1.0 10.0 100.0 1000.0]  \r\n\u003c/pre\u003e","function_template":"function y = logarithmic_spacing(a,b,n)\r\n  y = 1;\r\nend","test_suite":"%%\r\na = -2; b = 3; n = 6;\r\ny_correct = [0.01 0.1 1.0 10.0 100.0 1000.0];\r\nassert(isequal(y_correct,logarithmic_spacing(a,b,n)))\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":428668,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":117,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-12T21:20:54.000Z","updated_at":"2026-02-18T16:39:46.000Z","published_at":"2020-04-12T21:20:54.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven three numbers a,b,n with b\u0026gt;a, create a vector y with n logarithmic spaced values between 10^a and 10^b. Thus, if a = -2, b = 3 and n = 6, then\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[y = [10^-2 10^-1 10^0 10^1 10^2 10^3] = [0.01 0.1 1.0 10.0 100.0 1000.0]]]\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\"}]}"},{"id":44078,"title":"GJam 2017 Kickstart: Leader (Small) ","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/6304486/dashboard#s=p0 GJam 2017 Kickstart Leader\u003e. This is the first 61 small cases with no spaces in names.\r\n\r\n\u003chttp://code.google.com/codejam Google Code Jam 2017 Qualifier\u003e is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.\r\n\r\nThe GJam story is to determine the rightful leader.  The leader is the person whose name utilizes the most unique letters, spaces do not count, and if two or more people are tied then the leader is the one whom comes first alphabetically, with space preceding A, given a list of 100 or fewer names.\r\n\r\n*Input:* [names], a cell array of names using only A thru Z; max 100 names\r\n\r\n*Output:* [Leader], a string of the name of the leader\r\n\r\n*Examples:* [names] [Leader]; {'ADAM' 'BOB' JOHNSON'} ['JOHNSON']\r\n\r\nFor the example the first two have three and two unique letters while JOHNSON has five unique letters 'JOHNS'.\r\n\r\n*Theory:* Brute force processing appears to be the way.  Methodical processing and function usage can minimize code size. \u003chttp://code.google.com/codejam/contest/6304486/scoreboard#vf=1 GJam Kickstart solutions(C++,Python)\u003e. ","description_html":"\u003cp\u003eThis Challenge is derived from \u003ca href = \"http://code.google.com/codejam/contest/6304486/dashboard#s=p0\"\u003eGJam 2017 Kickstart Leader\u003c/a\u003e. This is the first 61 small cases with no spaces in names.\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://code.google.com/codejam\"\u003eGoogle Code Jam 2017 Qualifier\u003c/a\u003e is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.\u003c/p\u003e\u003cp\u003eThe GJam story is to determine the rightful leader.  The leader is the person whose name utilizes the most unique letters, spaces do not count, and if two or more people are tied then the leader is the one whom comes first alphabetically, with space preceding A, given a list of 100 or fewer names.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [names], a cell array of names using only A thru Z; max 100 names\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e [Leader], a string of the name of the leader\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e [names] [Leader]; {'ADAM' 'BOB' JOHNSON'} ['JOHNSON']\u003c/p\u003e\u003cp\u003eFor the example the first two have three and two unique letters while JOHNSON has five unique letters 'JOHNS'.\u003c/p\u003e\u003cp\u003e\u003cb\u003eTheory:\u003c/b\u003e Brute force processing appears to be the way.  Methodical processing and function usage can minimize code size. \u003ca href = \"http://code.google.com/codejam/contest/6304486/scoreboard#vf=1\"\u003eGJam Kickstart solutions(C++,Python)\u003c/a\u003e.\u003c/p\u003e","function_template":"function Leader=leader(names)\r\n% cell array of names 1xk\r\n% A:Z or Space in the large case. Note space precedes A alphabetically\r\n% Leader is name with most unique letters A:Z. Tie goes to first name alphabetic.\r\n%\r\nLeader=''; % string\r\n \r\nend","test_suite":"%%\r\nnamec={'ITWUORWMTIHLHXND','YWJRRIJNZBSVKLGZSTOS','ELAUQVVEKJMTWANC','EYHASDSIJOFKAJMOBES','FWWT','NCXHB','HL','RLFYACE','AGEOICCFQQQ','OA','HIIE','TCKTEPLEVQKUQEOWV','A','OARWWOWVOTHDV','PRZOIMYUVVENMEFTGND','TRTDGSTGO','XCNBHNURLC','QUDOEEPPPTOEK','CYCS','HLZHZXMWF','VTILQQXFLTHGW','JCLINHPIAFNTTJ','XXFYEVKXHHEODKH','MSMRUKZJGLXXAMZ','TCUPQXPTAECNWPX','YWPPGXGWQS','CMWGICOTZKVNXFJGPB','MJ','PEGZVIQZWWY','RAM','CDZ','BYHBVFDD','HJBUJRQ','BCYSCGACSNDEK','FAX','V','GDHUQRC','AEFTELYHXD','ZAJLLAHJTD','JTZINGJ','MUPIXBGXISKYTLFWEF','XI','DTFDCLELPYSXSTDTNPCL','QPR','IRTDYHWLDN','VGQCLWS','VZTYIFJRPKFENZU','S','CVWAFVIHLTVFFZYZAJ','HTJ','CFPPXYRGRJDAJD','YKZUWMAFLLOO','LUEP','DCIGCJBFQZ','FPITIZAL','GRNHJMHMHHLBRMHQAPDS','K','STNVAPRYZHYMGXPHKOT','V','AMZSA','HGQANFRDWECVUOO','QTDJYMJGHTXFBKHGNDPM','WJHN','QCANDRZEPCYONLCVIR','MEAR','MMUPHNMPQGELDXNQUNN','RZGVCAHMKZ','J','CYQAQULTG','SKRIQOSQJTFQXHLFR','DVTSYAQKECAW','IJQQSONVKAKKE','BPTSIFKWCZCFLOYZCHI','KJDUFENMXBMW','AGBYXTTYADT','SZUYKXYN','KDJNEQOUJDJVBYJSOG','SYKSOIBCKFDXBLH','NLBEBYUKFEDB','VIHKWHLQSIMLJXLBWY','XSPZPLYSMMQEU','OEPRNDZGFSRJBWLY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CMWGICOTZKVNXFJGPB'))\r\n%%\r\nnamec={'ZHWIEVQY','J','TLCILYLZBIY','FQDRXDBMLD','V','VDZCFZFVWOHRYEZ','EXIVJDONPLRYBSSMDNJY','BJUKZQGUNODOS','ZOWWHCMZ','PBPBN','CZTMQECVKFPDPOJRBKE','RFWTTBVG','LSU','NMRDJISMPYOPPBQRQF','AQOX','MFKXSJGWTB','TG','GMTVFGICOFOVL','NYFPRPZPHOQBDPDLFYQ','ZKJAIXOTXFMOGH','ONHHQFYAJR','YMDESSRM','ODUJTUPZ','OLRMFRNEWMI','PNJ','XSABDDN','EYGMT','SBNXXZNHZPDDSHDLC','YYLCARXECOAJRNIPAPK','SNKLYGHSEAJNXOPHDIIU','JGQHZFGVSQTWMF','M','QMZABHEHZNGWTXWO','A','IWSNMWEPVCQUVVSID','WWKOAMZASDPIVGSS','BMAWDVMNVPIOH','KDWDNRSMZHX','GHTSILNVPNATHRSKMKN','TXAGASW','YAEDJNTGS','ZHDYQVEVYJRN','JUZEFWDFTZJAS','VR','QZMQUWZZQFHLDLR','HOCXYNXM','HVLPIHZTLMPRWBME','W','ZU','KRQDDXKQEZYMWLXE','IYDXZ','GAAXUDATDVMNJAXVOGK','PEQIWYUYTNHQIH','UKRYPQDPBQXKLIG','IOSBQBICCHW','PQYBUJCGAXVCEVJYBS','YELCNJFSD','MENCFWQISHJFIGR','AOAYMFZBD','ERJBNWAHTOXCXHWF','RP','VUHINKNRTWKYGKXYJPTC','SQNYR','VDC','PJNLTP','LQSBGPKVEOUKI','ZWDTTSUCQ','NX','ZLBFCC','RFYNJWTWYWTMZI','FUZNVJGKXEYN','MS','EHO','GKJXLCUBUZPV','NRFCAVUNMCBEHIL','JAHZDCPWLMN','RWXOYX','GRIOHZEUXHMNSQSP','KASXYCVDKMRKLMH','JU','NTHZYRMMYIW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SNKLYGHSEAJNXOPHDIIU'))%%\r\nnamec={'ITWUORWMTIHLHXND','YWJRRIJNZBSVKLGZSTOS','ELAUQVVEKJMTWANC','EYHASDSIJOFKAJMOBES','FWWT','NCXHB','HL','RLFYACE','AGEOICCFQQQ','OA','HIIE','TCKTEPLEVQKUQEOWV','A','OARWWOWVOTHDV','PRZOIMYUVVENMEFTGND','TRTDGSTGO','XCNBHNURLC','QUDOEEPPPTOEK','CYCS','HLZHZXMWF','VTILQQXFLTHGW','JCLINHPIAFNTTJ','XXFYEVKXHHEODKH','MSMRUKZJGLXXAMZ','TCUPQXPTAECNWPX','YWPPGXGWQS','CMWGICOTZKVNXFJGPB','MJ','PEGZVIQZWWY','RAM','CDZ','BYHBVFDD','HJBUJRQ','BCYSCGACSNDEK','FAX','V','GDHUQRC','AEFTELYHXD','ZAJLLAHJTD','JTZINGJ','MUPIXBGXISKYTLFWEF','XI','DTFDCLELPYSXSTDTNPCL','QPR','IRTDYHWLDN','VGQCLWS','VZTYIFJRPKFENZU','S','CVWAFVIHLTVFFZYZAJ','HTJ','CFPPXYRGRJDAJD','YKZUWMAFLLOO','LUEP','DCIGCJBFQZ','FPITIZAL','GRNHJMHMHHLBRMHQAPDS','K','STNVAPRYZHYMGXPHKOT','V','AMZSA','HGQANFRDWECVUOO','QTDJYMJGHTXFBKHGNDPM','WJHN','QCANDRZEPCYONLCVIR','MEAR','MMUPHNMPQGELDXNQUNN','RZGVCAHMKZ','J','CYQAQULTG','SKRIQOSQJTFQXHLFR','DVTSYAQKECAW','IJQQSONVKAKKE','BPTSIFKWCZCFLOYZCHI','KJDUFENMXBMW','AGBYXTTYADT','SZUYKXYN','KDJNEQOUJDJVBYJSOG','SYKSOIBCKFDXBLH','NLBEBYUKFEDB','VIHKWHLQSIMLJXLBWY','XSPZPLYSMMQEU','OEPRNDZGFSRJBWLY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CMWGICOTZKVNXFJGPB'))\r\n%%\r\nnamec={'ZHWIEVQY','J','TLCILYLZBIY','FQDRXDBMLD','V','VDZCFZFVWOHRYEZ','EXIVJDONPLRYBSSMDNJY','BJUKZQGUNODOS','ZOWWHCMZ','PBPBN','CZTMQECVKFPDPOJRBKE','RFWTTBVG','LSU','NMRDJISMPYOPPBQRQF','AQOX','MFKXSJGWTB','TG','GMTVFGICOFOVL','NYFPRPZPHOQBDPDLFYQ','ZKJAIXOTXFMOGH','ONHHQFYAJR','YMDESSRM','ODUJTUPZ','OLRMFRNEWMI','PNJ','XSABDDN','EYGMT','SBNXXZNHZPDDSHDLC','YYLCARXECOAJRNIPAPK','SNKLYGHSEAJNXOPHDIIU','JGQHZFGVSQTWMF','M','QMZABHEHZNGWTXWO','A','IWSNMWEPVCQUVVSID','WWKOAMZASDPIVGSS','BMAWDVMNVPIOH','KDWDNRSMZHX','GHTSILNVPNATHRSKMKN','TXAGASW','YAEDJNTGS','ZHDYQVEVYJRN','JUZEFWDFTZJAS','VR','QZMQUWZZQFHLDLR','HOCXYNXM','HVLPIHZTLMPRWBME','W','ZU','KRQDDXKQEZYMWLXE','IYDXZ','GAAXUDATDVMNJAXVOGK','PEQIWYUYTNHQIH','UKRYPQDPBQXKLIG','IOSBQBICCHW','PQYBUJCGAXVCEVJYBS','YELCNJFSD','MENCFWQISHJFIGR','AOAYMFZBD','ERJBNWAHTOXCXHWF','RP','VUHINKNRTWKYGKXYJPTC','SQNYR','VDC','PJNLTP','LQSBGPKVEOUKI','ZWDTTSUCQ','NX','ZLBFCC','RFYNJWTWYWTMZI','FUZNVJGKXEYN','MS','EHO','GKJXLCUBUZPV','NRFCAVUNMCBEHIL','JAHZDCPWLMN','RWXOYX','GRIOHZEUXHMNSQSP','KASXYCVDKMRKLMH','JU','NTHZYRMMYIW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SNKLYGHSEAJNXOPHDIIU'))\r\n%%\r\nnamec={'LKVZZUM','IGFIF','LDWQNWLKKUZRSLNQPZUD','REYHMPLN','RCYUXMNRNM','KIXERSLPASSPBSZ','MOIJUM','CKLGNTVKPJUQVHFKOJYC','CLWO','F','HQBUXWNYFCKBHP','SZOUKQXZW','VTSUFMCZRBVWZXSX','LVSGFAJNPEAZQLQNXSJ','FKD','SHXDHEYZDVZMEKQXDL','OTXAYLGZXQYQUCUOTPHC','NSMRSGMRYNJNHRDBIJNP','UNCSUEFJWEOCCEAUVD','CLSFESORDOQ','VZCJFLXKE','BXRX','ULAQVGZMZDUQAKDZ','F','PQIRUOKFBEANPWHR','DNTYVUERHOWWWAX','NHMSAQTFXLWC','QGGAKSERLLBZMYS','XANXQC','CGRYIBLGJGITDGJXVQL','JMWZUQP','WCJ','DMXNGYCBWWBVWP','DXJHPUCLEYGNRJZJDIPC','LQHEATYFA','UOOAKBGYKHLTCMV','ECXDXYK','TPPFDLEZVFBHIBL','DXQZVMTOQSKGVGVEQH','MVGNOGJEKYUQCQWKONSU','YDXTWABNGHMVNNR','IHMQBV','EKORVOGNTFM','MTQZZAECALPQE','IIAXZLJMLPSWOXIFODF','FVMFSCOCO','KXF','APFP','CEUKJEFHPCE','HKQJYNMPT','ZEBJEIG','BAHVCJRQCCMX','WJKIOOPDLL','EMENSPOLPNYONCJPOC','LSLPVWSVSAZBKCHVR','FDTSF','ZUWDLZVKNYR','IFSFFUQJYEMFOSZBAJ','LFSNKMBHVGRSEWI','WGLBXIFWXQQPZ','AAC','NDKE','WFMWRVTOHZEVSUHQMWIM','LRTOVVMFQONLNCZ','DIUDEPSGTFKHY','PMOQT','BWONTNIT','LXXSEW','JCPZSFLQB','WJLMGE','URPRN','MJ','NJRHYNZWYDXJZDMBI','OZDCEA','ZMOGQE','VVPPYAQMZULHLP','NUC','H','FEFYDOVFMLNLLHM','KNPEI','YPYVMVIPFDDDOQCRHN','TUMWDLK','PSCZOXGBOLWRGXWLWETD','CZTFF','NPPDNACLYJX','SVMMODP','EBPEYFJCQFBIHNCILTP','ZSQXRMZYDOAICOQHPYHU','HKIEWXFRENDNUIHZVJ','UQIJF','XV','DRMGAISIOH','CCRXDBOU','DTAUYOKXRFPGD','FJFZDAMDODXIGERXXIC','NRPLMN'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CKLGNTVKPJUQVHFKOJYC'))\r\n%%\r\nnamec={'RZBUJBVYEBGFA','UQQZUUEPNZQGWI','MEVRXOPONULOFXCNJC','OX','AI','KQDWMQ','GB','UGUXMZRPA','JLPXQPEYBGKUPNOVO','DUNZANKBCLMRE','ZUTGVIJRXWBG','YBLGDIAFTFWXGJFSIDJ','MKPDQB','EXZ','XSPHULXTUUH','YI','SDRNMNHGLLAGWPCAQCN','ZCJHBAXB','VTWJZEWCDZ','DCSV','K','CXTRGSSG','TZDBKEGTJODEI','OA','ZZ','SGGYYQWGS','UGRZHKKCKLRCM','CWU','GAHGFI','EHNRYUPAJHEJQALIXXN','VNUUMZUMVTLGQF','JOJ','DTVZWKINQSLWYC','HNIELOMQRNWSRSFOJP','WBN','AZZQ','WPCBLNHQVQ','FFPEGUSPFC','QZVDUHWFOYF','MODJT','YPTOMLGWCBEB','JPBDAHELDOWYAHOH','LTYAWWOYYKRJUY','LD','ATWGLRGLX','GYAQPCCBMTKYON','EJGXJQH','ZNCSTJONBCWQEYJIOUDU','BQHJZZ','RMKTA','UO','WISAENKNTWQJJJR','QDEOAVK','B','DP','QPIVRVKJLTARRYU','AUEWOQXHLNOH','AQURWTVDAV','RI','VKUZECHUBKDQSYIEGR','GQXG','QPIZPWFRE','LLVFWQVKKVGQ','BOHSFPVLG','QDGNJQKOA','KHSIXTK','X','HOMSMBH','JASGHSCEVJPZEBRWIPHP','MZF','EEX','LDWAANCPMTO','DFOSFACRRWBZSZRGP','UPKDRRIGWMB','TLYLODNZAI','RRMHCO','RQXDXZBHA','TNN','RCEUCCHTGPV'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'VKUZECHUBKDQSYIEGR'))\r\n%%\r\nnamec={'RIVNPYCJWCV','OGILAGJP','SEMHSESRIMDCHE','JRYPYYQBGCQDMUVYTK','PUOCTXXCFLSVMSNN','HMTLDFW','MHRCIQBMPZJSNWPR','B','WBRPSYSLQUTYTMIOMAAD','X','SHHZDMOTCYXKOEF','JDWI','GVGN','SF','FMZXHACXMMHQJCZFYEA','RVWR','UOHRSYKYJPSYXBFCBUAN','EGGFS','MFB','IXJEMEXV','VOSNTCBQAHVSMQ','ZYCS','GWLD','TQHICAYCAHNMD','ZUPTJKZXKY','NALYIAYH','YUVBDDYUR','JSUEAMBVXC','BCGACYPVUKQJF','SOAEDJRTMC','GIM','DDKQJMZKRYYQUUNXJPLS','WAGEH','ACDMUQHJX','UJUCPFLWIWA','ZNCENEADIUCYTDU','CVQ','OIUWAJ','PELUGQEKQHSBEJ','ZVWEBCDPDPZYWKUEB','MUIKNTXIKIGJWJYZR','UDIX','EQUINTBTACTNCVV','A','QRQCTCOFGAGFH','GVPKX','XXZYHYCQCQOWTXHCU','ZYXQBZB','TRZFYLHLGE','MYLXVXPROOQACCREXGNK','HW','K','O','YJDRWVCHIYNO','OGFIXBXOECV','MYIPYKDMC','LKAZRCB','HBQIYHWJGQVAQK','KAOEMQAEDRGCOSWN','PEVMKNMBNQHJOLZPPU','WQGFHUTZXNKXXSO','DATMPBAWIUI','HFMNTXAIINT','EYSGATS','ELMSTZUCYKGVW','AWELUDPHWE','WXXT','BYZGU','QTKIDJAZOLQJ','XCWQPWF','SHZMZNSIYTFWGJMIR','CQTBY','PAXDKIQ','QKPFHU','FRVKRIYOLC','EVLSGGJROSCDEESC','BNBKELFFEIHEZU','GTVPGG','ABAF','CAMHBXEMVJ','RJIQNECRLR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MYLXVXPROOQACCREXGNK'))\r\n%%\r\nnamec={'IPRJSIWLAUJOORGCCTGB','QNJUCJUG','UESLBPMHAOXY','MAEFTMSUCVADS','HSBZYCEBXHQUMMQEBUX','WG','NBCL','JAVVHRIWN','BZUAGAL','KJPLV','BWLWTYKMYR','ZFREZGVRDXAJAOUBBP','ZGTFGRNBOC','SRHLEKFXDGXR','QHTBROH','OFMXKGHMRZKZWWFTQ','ZBRNSZCLM','LSWQXPSVOWACZJSCLPU','I','WTAWIPAXWSOHLOJG','GHUAFRDMHYCPJ','QLXLWQWPDMQBOOI','OFFSREM','LN','IENTDWRP','PWJTIKZWKWGHQQC','N','YNAAY','RVOXH','DGFWIGPZN','TZVZQIAQZHERN','QLAFRTPG','DVMQPCEHDPZXONAS','NIJY','G','ZKEMNSRWZTYIVJ','JYMWYWPARPXPKVDUSH','YSPFGKNLLGXNWHUOI','VXPCGSWYZS','UAZEC','YNMOLESKERXT','ZMKMIUTTHPVIJ','MQAJNGBCLVWFRKSWS','TIAPONYPCBCIPGISAL','ORYFPRXZXX','IE','PGXIAXPUVYIVFSO','WTOJEJA','YVGYRWBQ','JQARHV','PFIZDXYZEIJJ','GDKETMNEOWBKEGPEYSSG','ZDOBW','GMFZQLV','DSBYFWGKQRP','OKSLQUECSIFYKZ','HSQWESAVJDLINXQZ','KNKSNMHISGTREFBAPYOY','MYNDRKEZMOJY','JMTUWXZPYKJA','WMYRZZ','ZWMBGVZUX','J','ODBT','BTAXXZCTOGCYZQ','XUNNFNWSRLTPMJPFD','IOJUDXHUVDFLQ','IWCTLMAAK','EUPCXRCH','BTWYMHV','LHTILDBDOIAEPCTDES','FNVZZIEBPBVH','VKWF','XFIHRDLRIANSU','OVQEBIKFAZLU','KIWIAQJ','VTMFDZELACMCC','HYYKOUVOLFEUUVTLKXQ','TMRTGV','APFAJVKQDXWHQKHUMX','RMDXJSWKZ','CLMNGGNYCOCEWWQPNETQ','EZC','HZKEARCWVRFYVIIEVEP','LZVOTGOJKGSEDCYZTL','SLTOZPVYLCTY','NWCT','EZDI','FYQZYTGEWRTRCKMFFXAL','MNZFJM','JDGETBAYXINCKQOHVAL','FYRAVEWGICVW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JDGETBAYXINCKQOHVAL'))\r\n%%\r\nnamec={'TWFDIRYHKZDLJ','OAUTRCAUOBITSYPN','PAKWLFO','FVJFD','WGVEMOMLKYA','KIEXGQAEEOBF','BUVHDRLRWWUQODSWHPIE','QERU','I','IHTJCQAMKELW','ZZAKYHSVEZIQG','GQSPFNXGZMIVXWZKR','ULZACQ','UYMSDLYLWJQYOOGOF','GABXROMOVULLPPKPNLYI','OWQPFTJUXRDJXCMISMK','XSOPYVSLTHSQSTHQMQ','ERNGWNQQPX','DQ','QH','TT','FSTEFBNQWEO','MKVWBRBPDAQOTROR','DNCLYLKRHCAQNCDG','GZNENCWTPH','SKDFRFDQGLVAPB','DSLVXBRXPNEWVRKBM','SKLIWJAGBCTJXMKM','ZF','TJVTOGYRCCF','BEZOA','TCZKOHTZZQOFXG','CCXERZETXKLHNYCKJJWE','VVLGRRILCFDLZPGO','RVRAPLCQUYVRHMVZ','IESUGXPJKNYQTMZCVRK','UOGRYOVPBJPGE','MOQS','YHEUKZHUTTI','MCRDTEB','COOEAYZCBH','SOQAE','WMIYA','TLBNUDLE','H','EDWEVYPFKPBDXJDJBA','EXEYTHVVOSRRCQOXKUNG','CBH','ER','IJTMAL','VZJERSOJECHSEIIMFF','FGUJCUULE','INLHAWVTXSOBGKJYSO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IESUGXPJKNYQTMZCVRK'))\r\n%%\r\nnamec={'IOEAKZJPRPKTJNOZB','ZDUMHXJNYNAWNLJWS','JDIVFVATR','VAUXI','JQKKVNTFBRHSBJ','YVYMIK','AIQXIMDFGMSSRTYHP','JRKZIHIGDJOMCPY','LOCSUGBZ','JDHKURUFELAHR','CCVOEQYXGOVAJNB','UDY','AOENHSMZWG','MUZRGTCEZXFGJTAKAKHP','HUJASMIYVGGXLBQ','PIEEOUGV','WQEHQWVXPM','VCOGCNVNRS','YIHHJVFZFE','DZLSACBUF','HNKGSYTVZ','ESWFBPOSHGVJJPZWZ','CWJVGEJBTXXZZM','WVZMWOABZPQ','RITAGYKDRKQ','XTMKTHWMNONMJVT','ABFYDJLYOLM','WCLCVKQZYA','BWTMWKMXPS','CNGQQSPIMSKEVSHSA','TWQXHFWEELMHYTPCBK','LMI','ABKAV','HONTGWQREXDXIFX','HF','TNLMBV','WMLVS','RHWJXBG','EJBWKITPT','PAIVD','ZGNNXXNHYJAFA','HOSHEELTT','XLVQ','GJJOP','USGTDZT','VQYRFAKIVB','RAOWZ','KQLWBYJUXWMQZNBVRZIZ','WJSJAURLTKMFLYEWL','KCS','EJPJLYFZZXZGOGRQL','FNXUQATQXZFOFQ','CDDVYFLVH','LNSED','CZPKXAGODGOFBRXWH','VLDRWIFTLYNJYVCWLQRJ','OKCADKJXABSLKP','N','FMLVZNNHVWIOHTROTIHR','ZSLGUEEIBRZO','YF'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'KQLWBYJUXWMQZNBVRZIZ'))\r\n%%\r\nnamec={'ZHRKFFVTV','AANVPJKOEXCCV','ISEFLF','QKPAVCV','UFTMUOFYH','UEJBWOMUWVAHVOPFZFKH','XFYUAXTSOIPXJNTWEMVR','TCXGANJ','LZJDTUVDUSRFRBJVXTRE','DKNY','SKTAVBVQWUNKGSTH','LAJUEWXHWXN','UPVUPDPHPMMZK','PR','SKWIGGYNEQJL','ZYIQJEBIT','VPPWWZ','KFKDDE','ANHJYSMUAGUDLLZLGA','LTPOPUXPZXQLTF','PJLIPCUTNJAJ','BZBVKHGWXNR','VFMMGXMNRCYBLQCXO','KPYV','WFQPYLFRDLQLSV','OXH','S','NBNGVZVPT','GJZRZGI','KPWEPURIZPHQDUBXJ','VQJRZEPDCL','ANCGGFSXOOBVWLQT','PLYUYVFUPJPI','JUPDBAJHBWTHJ','PMIBCCWWAIIXIGFPJGQL','RDHEIA','UIVWDFNZFW','NHRTMDVL','YQNTKFTZUMJXSPKPVGHK','K','VVRA','HNRSPOPCTTDMSXPRMGXT','EVYRMDRCK','LUIZ','P','JXOLDLBOXK','O','UHVCWYW','TEABOYYTSAVDXB','ITZKZSMJMCXBDYHW','QIQGRVCUTCJ','TBRYLVVFHOAXWXE','BEGAPORIDU','JLVDPGMDTE','FTJIU','GUVILARGMIYRLPYR','OUJTQOHF','PSUVIJ','QVFZT','OLBISRQC','R','QXVWIGCUUKYSMO','JUM','AJ','RR','JEJAKMJTOINCNFIHG','SMTFIGBRC','ND','CVLGLCGSIQSJHIOP','IYRTAIWPRFYIIWO','VNFVKW','LSRGYZADGAM','IB','NRIVKGDDT','ZQQJZODVGHTLKH','SMVTDXZXVWYDBLY','TDNZHBGP'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'XFYUAXTSOIPXJNTWEMVR'))\r\n%%\r\nnamec={'VAJSYAGAOJIWVEJDZGMI','YONPJGZITZJHLBGMHP','QHEYGNWOSH','ZZXOUYOYUGZFHD','CBADRA','JOJOEOQIM','YIOWQROUDIU','RUHZKCBBKCFNUAVEWW','FEJJEIWMHLIE','GDTHNVFMFKQTBAAHJQXA','PEXFTBA','ZNE','C','EYQFRQENRMGKNOWBT','MUZR','VRUHHYX','VCCI','IOVUGNVRQMWICRZUAEKL','WSRGZ','OBCFVASFRJJ','DSWYSE','IBCTTSZG','BHWWJCGFD','IWZY','WMWWGTDRUXNAM','VEWRGUWKYXYTR','DIWZAGDPFXAZHBHTWDD','CYYESJUIZFB','GVT','QRDYACFPBRAZ','FNQK','VHJENXP','WXYVKOVH','TIILZLAYPTYK','ZGJSV','KHCYMARUVUVCQCCQTJH','ADVG','JUVMQXUCCTBXKE','EGRPHHXLHS','NBDZPHWXFHNDKIO','XQYV','DFKNQRCCXZFSCFDZKC','GE','UIYHHSUFVKKCYSTUENRP','WSLZUMBZNNZHMYRCJ','BLLWRXTADEQRWUME','NVIIH','DZ','YBSHAVJPKJSOSIKZC','QCEZCG','TCOPDCOZYFB','FLWPINXSISEQMADOGXD','ISDCYUSAQTI','AWVJF','TFZPWH','ZWOTRPT','KVWXCOJVW','OHHPEO','KJMCI','TWEIKLTAWLWPFHQVYCU'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IOVUGNVRQMWICRZUAEKL'))\r\n%%\r\nnamec={'QYNQXKWTBWLQAV','QFZBOBFFKUV','SATCT','B','OEU','EDYMJLOSFVXKB','XPTUMA','YXQHUTMRWVXCFN','C','NMUKSZQAARPYKBOJO','VXSUODWMJEOFRT','TQFODG','MVAOPPXKPOYLKZP','AYOSNWPTZNEHFENU','HLAOZUDPGO','BVNYHTE','LLBZFACMMNT','FDCGRYMFSZKECAOD','PCGVWGPEKPRE','T','IQU','PHAJAXB','JZSWKRHOTFWHB','SXLJKBGJNSDVE','ZFOGYXBE','XDZZWSGBUATBEK','IB','FTUTZJGKFHOWSYRC','QZZQZ','RQHRGEQXGWDDVSC','SWAPIZKYUQDUCY','LAQKSCDQQHUHROUPZMPK','KUHXDFAYDTCFHE','YUIGRMJCHOJRLETBLSPH','UPZVBPVFI','GC','MDBPULJTNVIBPVKWICXY','WVQETK','CONDVZ','YFNHSVAQOSVWUG','VOZLYCFAH','VDCQAHPSI','WOJGQPZHGJCJZODPR','RZGYDQOLMCZMBQILF','MQHZBD','QNZIDLDMZOYTJNBDVLK','SWRFWEZZO','O','BRMETQKUMPVZ','BOHQXMICZPIJINBAMM','XZHKWHW','PIWTIMWDW','CSPMUYEFTM','WKQVYHCSKLCGA','FSSQOLQOPVTPSWX','QAILVSVYMY','ZMRDNBAVH','EDLNTXXI','L','FPT','NGEWBBCXSCAWFZTIWELG','AP','SUIWNKPKEIV','AFEUBXU','SEQZZIPOXRYFSI','PNYPEBPJFKU','ZJORBRZJBKSRPGZEC','VRFWCOLARBSMCCETVOOY','BBWSSU','JHDXBKEBTBOFKCQKKGD','VBRDW','CZMEFIYGRXBIZYQAOEB','RYWVQCXMOTJXRE','ASTBGVNOWKSD','FZ','OESEXTKXKGXRRZXAAHW','GCNJIDSJZWV'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MDBPULJTNVIBPVKWICXY'))\r\n%%\r\nnamec={'OLBECAKH','WALVIPXKS','UKRKEEKP','ITYJJEIAJLK','LXFEYKGNJRXIAATYUH','S','CFFQVCOZTQBCNKTKIKJ','ADMOLGEQMVHGYZGS','LUIKBIIL','KICCEOKINPQZQXRCT','UIFD','HRHXRIRTEO','POJWXUJTLIXYJUTSP','EOVOWA','HVEVAOIPQHTQWN','ECFXJL','XYEIYBVBPVVKFSESTXO','RTRAHTQLTLKQEB','LPGZRDYFIMXHMOKTGV','RLJUFNHRFMHJGEJKF','NYKPGIMSJNI','SVMDJTMHYV','OLITWNGCMC','QUTJMRHYNI','RIVJRF','SREBXWFBLVVBM','NVYWUKFVPXYQG','NDUGBMD','PQQ','VMWOYCLPJ','OAUXTTK','JJXNESUVLYMXI','KCAZLCEJZ','GD','IEN','PEALDLHFHHSYLOPPVIFU','RIPLRWHJKUXK','VGQUYLBAHIQVQNDUBBIE','WMYSOG','YQZWY','QJJRZKAN','BGGBCNY','HMVFIHNDWALIMJQVJ','JRHXWKGQQFDHQCVQFV','JBWXLCQ','U','UNAMPIJF','MEVHUELFG','UYBBK','VRDQ','BBEKHE','DDOKPNHLFXBERY','HTPDIXJZYTYUMXSA','YFEUGAHWQDYQXZOJHAA','PA','QYKNVGZTGY','EU','MQN','QVX','NQTHFIMP','PVXZFAVR','EHXNBUURJQ','KMFZUNNDNRVEOMM','ZFUOZTXEIKSFIUKGPG','UTOPZCQLLXQFELQHY','ZWAPCWIRETB','ODSGLVJMCQT','FGYCQONLQDRLNXXDU','VWRMDYLJAA','TITDVATQS','WDQLGGUTUCYX','ZQLXPDNEEDARDL','NESRUPLFJKZEEUU','FLLYHOYZJFVXKJCWART','ONNXRSFCTNNH','YPWYQVYD','KAK','PUDMLOAVFUZEOY','INPQ','BMGWA','FULRYCCYXAANRTEL','EZZVVDUQZ','J','QVF','PIKBTC','UZCHTCMK','PA'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'LPGZRDYFIMXHMOKTGV'))\r\n%%\r\nnamec={'THWUPQDIQCGC','PHRROUTOWKFBLHCMTBJ','FFZWHOUBDJUHXCQER','PRVUGWJP','OUTCTVJWJQPL','GTK','SQ','AWEJFQMXOBZ','XEGDMNGQUBRRLDH','ZMNYRGDGAXOOV','CEQTQEHJ','ZVYCZLGIFQAE','GKKYTXEWUU','GYKQHFBAYMYJOQ','ZWBFOM','Z','JRQMYCXC','UBCUROTDPZ','V','EWSSKGQGPDWU','QFVZZOTIXD','LORCVQQCFS','VZXYJFGKNGEDGZYJBDD','ZMHTRZAUMQ','SWS','M','SQ','YFZTAVZ','MME','BNGNTDVLNOVD','OWELIJBQLIPJELRCBWN','OYJUHFIWEZFFXZJSK','OJAYEYQRUWEWEL','EZQAUNFB','PPRFEXORKNUZKYRPGL','WMFKLS','O','ZKUCHI','UCQGSZNQCZBQO','JFATSOYNQHPY','UGLWWJLKXTMKMUJC','KECCXUIK','YRDKCXRFIBOLLAXBE','KLMCF','SOGOJXJLRDWLAWDUO','VKDYIGLD','HNLFTM','YPCWFOTTS','DHBFCRNIPQDMPRYUGGSF','Z','PYEOXJXSQQXSZSLPWPBJ','VHICFAEPWBHQQNZWUFRL','UTQGM','HZQHVIRP','TOFXMCSPXOSRHZCTECPV','EMRVAZWTJNRCSTUOGUPP','OLLEHNLX','DCVDNPHCJPVWKMZFJQ','F','YIOJIRL','NBMIBAJINBAXVMKLMFVJ','HKQSHURUVVKX','ABQYBBPFEEQQC','ZPNIPVYDTQO','BICYYSSEXWA','ICYZSXXBBAOVZ','C','QMYH','TDAQVASCMQM','BOCUUTAX','QSD','AOABNRE','ZY','LFETHZKRZKOU','LUNDNYWWQTRCUALDFACW','UJTAEMHDBKITB','MUGDTHGOEGJB','FUWZQEVXPZIEWJQVODQZ','WKG','TCWKECYVIGXY','IHFEUPHBA','VBNJXRDJACJXCXVWBU','RUUSZNXDIZ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EMRVAZWTJNRCSTUOGUPP'))\r\n%%\r\nnamec={'XHS','WZCIBW','PREIVONCYXIZGZP','AEGSLV','FHXOGTXEVVVRJTXV','RXHOMEOTXATLTXBL','XCBYOQUKHHHYAO','PLVIEU','EBQQAAPVBJFJVQRPD','SGRTRBFWDE','TFFLUTMWYONKXMRDIHB','GMFCNLRIPZMXBDMOZ','UAJNMJH','QAXPMUJXEBOYNHIT','ZZW','AXIUPAFWNZXBTMFUW','DKEWEJSZGPSVNSDU','IEBZCGKAS','OGBYKPBYQWXHNGZINIX','VBCXBNNH','OBVVWQLIWS','NOSXD','TZFNK','YGHAAWVVINCIFVOGXWKT','RQHIFXGMQGDIUY','DSIIBXODN','NDBKMRKUOZSLZALHQTC','CGNEDRZIMLQFNUI','JMEJXLRN','VDHTQHPFCZACHS','YPSOTBGBFHYIYN','YVCNHWIYH','AXZSIOHJVA','URPHIVPD','MCR','YRKRGC','X','KHUMUNTDAKIR','DBXJJYUNAWQPFPSI','BTABQCBZ','FRTKUUIUCWNQAOFCDZID','QTMRQOBSKNXPLGYLICC','TWHNUSZIF','GLKROXO','JZFZXDRQOQFHXSTLGI','MYNSZTOAOEPJXDG','JW','IHZKXRT','NXCTMPGBVHRNQLIWMS','LNYXV','EUR','OOIVOTFMWSMZEAGKLD','JTJW','NELD','RLHASFWXKXYXFFAUUVTN','QQAFDL','VBBORVQPHPJWN','TNTQDKJHORHLNLXJC','KIEYZTBC','X','TMVAVQ','L','KZFJGS','V','PAXEXKPY','SURWLRNTQPLUBJ','VXXWUUCFP','ZZMJBVPVDBHCNTZORR','POFFYC','BVCIXQXGTZNNA','JGXSGKZNRZSOTM','MCREZTN','ZYGBHQELCNWP','RZOACKCLGHR','KFQGQGCDFCZMZMA','KAEMYPLQOU','ZLCXJAJPDSAXFES'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'NDBKMRKUOZSLZALHQTC'))\r\n%%\r\nnamec={'QFUAHWIOOKR','ESSXWCVAAXUNPKZBP','XOHBWMTZWPVDBTZK','ZZIAKKZER','TCJNAIFFANO','IHFDHP','ZXVEQXNTNPI','XNQCBWRJOYWNPJGGYOA','DNXYBBWQG','YIDQFQKDCYQ','DOPKJAKR','PCLIEY','GTL','HFJ','I','SZCDBDD','MUKH','SDUFF','QQUNPTRTNRGEMJHMBUZ','TTW','JTF','KLVWALNQRKUIBBKFH','VQRKGXQII','SAGHQQFQ','HRZXSDNB','AMJPRLRVVPUW','NUEHDIBHCGJNNXODCSYT','PFWMVZJRQR','YG','SNO','OTPEWBHKRLCXZOVQB','JJJZPVFVFWF','HZVUBNI','HCANPJ','HFPROKYIHYAFKAX','SFWXOTAIUNXT','JCGZXAZALLS','ZDAPDIF','XQWPRQOFP','BATBRJYMEPH','HWLQMBPJR','ZFXBKAVDWCFKDVIPZP','DXHHBTCMUMMHRITW','MYUWULXGAMCXUB','RUTVCBDKKBKVCODTE','JPLGOLTIB','NKVYBPZFRTWD','DIKMPNLVRWVGP','TZFGVBXIVVKCN','ZQVV','LYUIEEXPSCVGXPAXGNOQ','TVDFNASELMQBMUFRF','TSAE','WTBZJNOXQMGJACUF','ORJDPAIHTADOOOIMKJR','CAFVCRS','BW','MSNRIFUX','XYG','DXNEAWGNPEFEI','CVCCTO','BKKRJFUYCMQVACQBUH','OUKRJQKTHTEKOGWNAJL','EH','CBVJJGAMPB','D','JCX','GDNERYKFLCEMFDGHBLIA','ME','OCVXQRKNLMDIPG','DKXJ','YIMDAGHEBVBDEQLWQZBU','RJOLHANYAZTAXYJ','UOGBZSXATOR','RPWKKLKMITC','ZEMNOKORQCIGT','EZSILXKGHAV','EKYJYDR','LYHVGIR','GIRVT','UTNQHEBGN','XCIRJWQPWZWDJMCHBA','NMAATFTNDCKEKOGY','VRR','HMPLHONBSDYSPYYA','CETSSXCAJBG','AACEYNLPMBJXZSX','GDETCLD','KRVKTREYTUWLQKCQGFNY','PWSNIKIOODMZCEHSS'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'GDNERYKFLCEMFDGHBLIA'))\r\n%%\r\nnamec={'AYGOJBGQSGJ','UXAWUQATLCHDBW','EMWESHWSFIE','LYDDIYTAFWCMZFZAJRI','PHAZNAPRSSDWVEICENY','LDXHZCQWCQKQQXJXCL','LYJTSODMNVPIGOZA','JDJI','QGFJ','Y','FHJQVEURGXMVQ','BTPBCD','AATAYYOWE','BRUVNITJXCXJHYUWZ','RFGRZELSDAEKRSP','RKBKMBECPVJDPUOOYZ','F','C','RESFUFHIJMVF','GPJXBWH','QCJNXDPKIZHUXDTBXF','DLNOP','G','TPRCBFEBBLVYG','RWIWDZLDWSE','CXBTNANPRQUAGKX','LHRGDVJRJT','DOHFZ','JQ','GHRGNOJ','ZMGESBZULEBZAPYLPYUF','Q','JZKXJTOBMBUOS','ZPDMPTGMAOMTA','X','Q','ZRXJG','VHRBOCEJ','DNPJ','TE','W','SSBFLCL','X','TVMWRYCCTPK','TSPJCVTUO','YQUOBBOVIMFZHRPAPD','BG','USIHMQUJNXQEBBT','BJFQJME','HHBFBWYBVGJLZSYKEUE','OXMPYRXDVDEFETK','OWRADONHAWNMQWFLOC','FLBZA','PDTOJDXJHOALT','XUIDOPAMCTYOWN','BIOCHVREN','QSONQOLLM','ZOHOAV','NMVVYUJDR','XDLH','TWXVFGJLNPLOQJFVM','YNSCRRKGN','EYLZ','YLCVZSWWKT','WKAVXKP','ZJDAIPTKSFN','AB','XDBZLVICXHWTIRJIRQGT','MCBDWUSNJNQWWNQPM','USFGSEZEQ','ZJPRVZNFVSL','FSQFHXFDPDVLLLG','SPDFIBSWLSQRO','ZHVWZ','XQCTIIQEEPEFDQYPZLMJ','HITWONOWQ','LQDK','HGR','DMA','PKTIITITLQGSC','WTMYNMBXQEFQIYHGNHGY','RHNONCQOYTSLBLERI','ZQ','TYZZBXTJ','RRQXASJHEPCG','EBNTNHG','IALSDUFLNWX','OADQT','ORS','LBYYIXQJPSSYVBNN','KKAKFIWWJIUUJOGKH'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'LYJTSODMNVPIGOZA'))\r\n%%\r\nnamec={'JKO','OWGREQBHQQUMLNVUWQBK','UHVVBFHIGRXWTTAMJJKO','WJX','SFIBGZXGZUEM','BYSUOAWXKPCQSX','UPNYKWBRQSFGCGUZITC','ITVPOFOUKJAPQX','WVTUMGBJBBUWFZDZBX','CQZCXRSQ','KQWLOVEPOFFEDVG','PVNRITWZIAWKAA','DOQA','ACAPGNWKVMOVE','CWEFWFTQN','QVPNNRXCGHGMLKWAT','YNPWDBTIJYNG','YEFAQDSSZ','AQHQWOIRP','ZQRZLGACEUJSTROOGCJQ','SPL','TGBWXKJQJMW','NKBYESOH','YXYE','NXVGP','QRCYSWHKJUUNGEM','KMIECA','HXCGAIWRKJDQ','EVEMIQWSU','ORY','YHBAHCORMXPHBPM','GIE','ESSZLCMQD','PFNO','UBLFILHYXVAXRBVPTQSN','PYVGVUUQOCWW','VIMJNOMMZVWIMAHG','FURZKEJESYJB','FDM','BIFNVLU','T','AVCYWH','QQF','QK','GPRHV','GTOKJEMWEFGVN','GAXJID','CJHJ','APLORUKKCDHKL','XZPWEXZW','UOXFBFQXHS','GSJHWIYHAXSRPHIGG','G','OLF','TU','ARRKPSRLTB','KKFFBDJHHGSSG','VHNQKMLOR','YWXRSYYRAFNYDWRQA','CKVOWSUJGGXVY','PSUI','MUXJMK','EYTHUKVEVDFTJLDC','OOKYLAR','FTJNSQZVECEXE','EHSXVDTVNNYOWLL','UQJLAUKPOTTJQSJKWUX','JMSIXWHFIQEUIRAEY','XFIBXKZUXSLUIXNFWN','MNMERG','DLTERHWWCZDW','YVSISIWYDEHPARNM','QXI','CHFB','HSYWFLNPTX','LRHZFESLQYKVCHX','GD','JDQKKNOAMBFLFPXVMMI','DKV','DWVXMWJWT','FZM','TRYYOIHQVSNKVLCFRR','SK','APE','JNYDIADPTGRHTVWV','OINTXWT','MYSVMYHMUWAB','JJKWZUSBVXKR','V','C','XHCKOGAB','H','WGY','TEKKJMHVZR','DHBCBLI','DHFFTEMLQVWUYYSZGZ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'UBLFILHYXVAXRBVPTQSN'))\r\n%%\r\nnamec={'EYDUEHDLGIIFHA','XNIGHCY','AMLXIFMEBCIBX','EWMEKRLKZPZDXTT','LXYJTDUC','THUQYBENQVIBDTONJ','FMRIRMQQLHTW','PFQHNKKDYQI','PGCEPKNOHRAPVWKNOZT','CYDECVFCTMAVIP','WWBBORAFBCTQAJW','EWGJT','UCXMKAYWHQM','U','RB','BSBUKVUXOYEPWHVYGA','TKCUMOZNCSDEJ','ZAXTHJPOBNNWAU','EJYVWLFJQTUZPNV','YJJMKOZYGHJ','QZKISVFTHJTW','VSAWHHKYNRZYEUEIJJ','RVGZSNCHLCAKBCEPTBP','TUH','KQ','BPCICNHHES','DZSKRLZJHLRUOZBPCPEB','MIJWJNMJWGSEXRN','UWMSGMUCTRDYV','ZNUWDSZQQCZF','HEHFIHHCVNQDZJW','TMIUAPEQXYP','BMVTYNISYOOZEHLEFBEJ','NYYVNSDKJPA','EKRYBQPXC','T','RUBGXOTDRVMCSEBWP','NBLAQIPECGQ','XQFOAQRKIVM','FKDPYSY','TJBVPJOBINRFKVGU','YRPAKHWHIMHJNURPEKXR','GTMLLKGRSFCFXCJAMO','VZBWFUMLUCYB','ZNOLDI','LRTPCKGBHQCGJWADSCP','AV','ZNNKBC','DEXCWEMD','VRY','HMTWGLNLGMYTPZOCU','SJMKNBWQZGUODYZRAGA','EEQLXAGGKYPX','YLHLRDB','GSXSZPWALUIX','IVLSPD','RT','YBBYZ','MOKXBR','XBNCBE','ULCPP','FNGBCWSTFY','ZIFTHCMMEO','KNLFCQFIOKHQAECVCT','A','BNLUIXLNQP'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SJMKNBWQZGUODYZRAGA'))\r\n%%\r\nnamec={'WGYEJYVVSPVTUTIJXS','UUQ','KK','HNV','OHN','ZDMRXCBS','O','FSNHUPLNIDWJEGHBT','YWSMRUPRO','AWQQD','VDJJS','CZFZ','FMVEADNMWAGZWDAYJN','SXXGRYDF','JR','NRSVCSNIFGIPS','MZH','MPIAV','KKWMUFUZLLCGGBDVYUI','DPYHLZRVREWMVPRUEP','MVSTIJD','GUNJ','WBYOQS','DGYHNMEZDOXPPVQ','OICYPYRJIOSCWAAJONB','CRYRIKGQGKOQXYDDNG','FEKWGTZXNEXPKNCJMEX','YIPMUZAZYTV','VGLXLQFYASS','WO','NICUG','PGBZKWJQSUB','W','PC','RIM','CYPJBH','CZEY','MNYOFOFCHJJKISS','OUVW','LZYPTUYWEB','FCHD','RQBHPP','DHPYWWOMMA','IWYBPWUKTNQGVKGZC','ZJTJBZNGZJGJDIR','QSCZQP','WFOTIGIH','WUI','V','LZGMRVPLQXFQCTBCR','EBIEDK','QJNVGBMNMUGBZOZO','DAUURYORURRXCZC','IIJMVNCTOTEJZIASL','FRZFGSBMPC','QODAJXGTQYG','TQNGZJ','BT','ZCSOEDSMDDL','LFL','MAZAUJGQKR','VUPIXAEKXJ','MJAIVAZWMIAUGMCJ','ZKENPXEYPEIPAAUSSRGK','HYTQUHOWEU','TQYFVCMNCCBWNKVXBJ','UEL','XXFQJTP','GBDICDZMQGZB','EYTIFRXVXXHYMOPKQDLM','JHNXZIYYESOF','BHQVGLMSGUWGCDDSQ','NQMIMXORB','QIYGZSPCJADZVGUK','IXWNX','HOPAJ','FGZPNTQNLLACJNMPVHVE','SPGKGPJDNTHBSJCNS','REHDRD','RLTRDVVQRCE','GAIKLPUP','KWSK','ATJQVAJ','EX','Y','KEZQ','AGWPYYDZNCNO','FOSYLAMECGMZYDGWJUE','CEEMW','SCEORKXPICZT','BLPVKTFEKYIPWIJRG','BFWDAMZCHOIARQ','TFSX','EXPZQXEDAJYRYDESCLY','NHCKRRKWLZJ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EYTIFRXVXXHYMOPKQDLM'))\r\n%%\r\nnamec={'HXYQWEZERXBQFZECZB','S','DMMXSNMRHULVYIJW','HJNZMIEXBLDYQJGFI','MHSOVFVBKINKFJHUIAC','QXUPYMVPVJTU','DMZQFZKHWTHMTHGWYAM','YBVQQERRHBVCJHSROXNU','VZIQAYEL','NTYENEAFAUEL','KXRKXJFBRXXDUGUZRH','B','WDNCGMMYKFMU','N','WAKHZBTPTSPMKZMMXR','STVWJMFSDWTXXAI','TXYKWFIVOYBDQ','EUUW','RMTJBMY','UM','PXUMUR','LBPMXANROSK','TPWMFVZDGKXSAKBEDI','BGVOPFMPPJEWBIOZBNF','XGYKCKUZQDJYAGG','OPLGJT','PHMNOKB','MADXMUBPA','HBWMJZ','KHHZOQKAMALE','JQQIPY','RILSWUD','HRSXFVPEZIIV','ALYJ','KZSTZVVFTYLP','JTN','NOXKHEQILSJGJI','GTOCIJMFH','KW','YHOOKWWSVDGW','HB','NM','QMYRYVR','BJRRIXF','DGO','JU','DYLBWTNIIQBRFK','QKXGRHJSUENSBAVCW','HBCH','KDXTAHUESOKNL'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'QKXGRHJSUENSBAVCW'))\r\n%%\r\nnamec={'ALLW','LNSMSPJJY','RILSPNVFLULVXZVEFFBT','NHPU','QOAEOLWVQ','EVWYDNSUOKB','LUFQUUUGNU','TYYDKHYTYYEJU','TNAAFIIRG','PLLSBFEHB','BMUG','SMKYMCUJKUSR','DVNVSKRLVTQKKOMBDQM','UOJVZJEJECBKYTUDHXYJ','YBATREIH','RICJDCNUOZQV','CKJWAKLJGTIRPRAXOCQY','ANHKL','MOHIUTJIJHPAZAUBY','TDMYDRBFRZBYOFIOHHH','QYRXFHJXVYTSPNO','FOFMTDRGYDP','AOKHLHXAZJAPVVUKZRGH','BQEZMUFMZWEGVTHIA','TWZQYUDBUBCGUK','ZXGMHKSARUPAEEWMIMP','CJMWHCDRTS','BZLQQIOQELAEXI','BSCKWYRQE','PTUDPBTD','M','NQSFMDOU','YWGQJ','YTVGJLJQEUUFSC','XSOXR','NWHP','OBZWDZENZD','FAPOACK','QJEOQ','URAQBEARRMWWJP','RSRXVXJAQJWG','XOULTQLED','VMMMVDXB','OQGOOWPVENYYQCGHHK','SOIXGLQIAPHGVVO','E','DCESGRNXJ','MRKV','JVQUZIMJUQTXSXV','JQFCGOGSYYUPVVRHTEHB','JYVURETJOGIDUG'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JQFCGOGSYYUPVVRHTEHB'))\r\n%%\r\nnamec={'GHEOXPV','ZHI','MNFY','YEWVTZJ','SQRXALITJVBJBKOGCNK','UW','VCGKSYD','LACBYWDZYRXUUMDSWEA','BVQBEXXMHPKBQPT','JHAT','ZD','A','XNEWHBIDQ','LBXERLUZYVJ','RIIJASYOPIVQQYYZ','YEZGD','XGT','DLM','LWXZHBIP','ZJBWEPIBCOE','MNXWRV','VHNV','NODYUAZMCNFYMBO','YGEPCRFJXSDDSSSPXP','GEOZMOVT','HNMWNBRLIXS','ADZSBCUVQ','FNHGFLKKEVWNP','BQMSNJCTSYQSHYQVT','CPPHYPDVXPBTLJBCV','HVXIWHTUBFRQ','LPGUVAJMLLFNC','CBARIUY','KZYTDHXK','JRVJSZM','ARXITRIJEIUCPWNSVGSG','F','JPGNHGAAGM','PVNPNDFHSULUZUGVMM','TKLQI','XWMBFIGMYRIVHITGKASG','UDWHDNWRSXWA','OVCEEBENVWLXWAADU','ZTUBMITFAPTYKXUO','QTQIBJAXBZFSNZJO','RZEJKYUBSAZIHUZZTEBN','T','UCWBQVB','WSFVAWJRFDUTNCH','WKOVPHAEUKB','KXNI','MIHKTNESPUOCU','RTEQLAVBCBQHBLTU','SAABESRXBX','VUFKQNNRDEKTEUAPKL','DDVGOWCFTHGEUPQ','TFGPZG','RXUQOEXSOXYE','BCSOJJAGDOXJHVT','GBMVF','QUF','QTZKJTICPIKNX','UHB','NYUEWII','NCQYPHQBOPBZUYHCXAK','YADQSMQRSMMIITHHFA','MBRCRQELQGKCH','LZZO','IRIG','EEHQAF','JNPMVWWYVIPYWUYTHCIG','MKIBIHSMPAZPTUNQDVTT'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SQRXALITJVBJBKOGCNK'))\r\n%%\r\nnamec={'Z','DHOWAIFQBVLAERDIZZR','OI','IDHDDVZ','NZLLBCKEYOOPJ','MSSIHR','KYLNPGPUXHBEAEGEU','SKUS','IRNRYAZYHCBFJ','QX','QTCNBH','MN','O','MXZEKVRXPZNGLGBRZDSC','WKOVYXZ','SATCUZMGUZ','YXF','KXRRN','JP','ABVRKBJADWVVELBWGL','VWJ','FSTDKVQBRXVVOMZ','PQEFIDQCYHQDDO','WJBFZVEMWRDU','HGEGY','ASTQOOAHJVE','MDBQSSTJKBDJHYNFS','FHNNVOCUPXZMFNIX','RDZVE','PRNRM','WDQYYBSTFHJ','V','HFVDSTNTWSHBARXDRUB','FCFSUBZSWUSKY','VIEJQCXLMFIBGLG','IQVJMBBYMEQ','RYCQYUO','CTGERJCSRTBXYTRXBO','BY','OPZEAXLZVA','JRACFXQDLK','NBKBZMHLHD','ACOVTFVJGABIZO','I','NRBGNNN','VQTNLZW','SX','LZIAMEGC','WXJCY','HIUXVECXYWESAHFA'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MXZEKVRXPZNGLGBRZDSC'))\r\n%%\r\nnamec={'FZPHLCQSJ','ZJGB','OZEAVWJBIXGMNDIBHB','YUJKVLJUMREHVEUF','NNTS','PSXIZYTGWVQGCO','ANSZYBJHVURYFFRO','DKMKYZSAGDLS','AOMQHNPDDOJIXPBTR','LBJEQAY','LLTRPZUNPX','WYQPBSS','RWRSINKDCVGOJNLDY','CZNT','ODPRRYOFDTHNEA','BMRAURNBMA','XH','CBEPGYFUSLX','PM','YR','GPERILIKMEJBM','ZLNQVLPDTYDXFKJDN','YNJI','VQRYWDQZKL','VF','OCWRLSNYXBKGAAPB','R','XBMBOMSJFMLTWHEIASTG','LFJUCYAAEJOODRDCKDSZ','QRSWJSLZUFZLWUGEXA','ZZOGMDFVXUAORK','NWWAELWYHUVGGNWBAG','MKELXTBXDL','UYREQN','BAPNNWTONMMAWRLPG','ACQZOC','LSSLSEZBGTCTHPYI','LLHJQHDYZK','AVHKKSOFWDMEFBLMZ','EBLAJKZEFFASIKNPVQZN','SI','OLZVNQRDOJACJIBTGVO','ITHHHPSNOVIFEON','PXAQYXXXGNJP','QOCCYQQIQOEOSH','ZBSLZMI','LBRRLYMAGVZ','AZB','HEJPW','IKPDOXNSRWFUQJJ','PBEIXBHIDAPZEXMSMF','AOQ','DGGUVQVWPWVFXYFILK','IOUMLOEBBWHUI','TY','LJYGUSMUVOOWE','LJECMWKCAX','YFZZYUCGAGWUL','KIKTMLRIOVBYXXJ','SODFBPHH','NEVZIFFIIRMTVDROTK','KRFFXGUW','TKLPKQVSQABGWJ','PFTZPYAAAMWGCMQF','NLGALHGVHELLRSYMVYF','ILUVTZL','IONIZNOQ','OMQMXZWWTFGFCCN','WECRHJZVOEIKYY','GCWVGIS','NUGZXHADWNACB','KPBHZOOZ','SIPZLPMAXMVSEJ','GCGDMVXNVL','GXPHICLKI','ZUD','JOQEWVRQIYFDJN','KHV','GZMTURTBSJKWBBBJCG','HCPMZ','ZJXEEMZVCGPUP','EJSGSH','ZVHTHMPYYKDPILIZDDB','XJUSPSGWSXG','MFUPWZBS','EUHW','JPWGKNPJGDCE','HJ','ATZ','IU','KZTYEQ','YTQJOFASTIUQHT','PNACCYGUDBOWSQM','VEVJECRAOQIWY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'OLZVNQRDOJACJIBTGVO'))\r\n%%\r\nnamec={'YRMJICHXATZTRMJGAR','FKNDFFDBNZQRYNYGNX','WULIPQKVMQPRZUELHBF','XTWNMDKPSAH','HJXYQCTHAGWPICMC','OJKOGHWDOMMHX','NLEFJBMBM','NGPUQZOCKRIXVA','WSJGNDAGQHUO','YEQVSTBTYKTQW','FBJOFTUVSTLYXX','JJGUKEKOVNYKFBSZOGR','AQH','MQTLVPBSVWYUIELEZRN','LDLZDHCVLLKWKBH','MVZGDZCOAXTDBH','YE','TZSAKCU','F','XWA','RDCJXSS','ARRVMVB','IXKZJUAMN','EBBDOOYDWQMBHYO','ROFCLQUT','EDFUXWFQIVCUOBH','QMTPEIDOHXNEMUEBTMB','GNRIMIMRKWSRQK','CQUOEKTFWBZILEI','MHPZY','PIFDZOFL','NCWRELO','FMNFQSF','WER','UEYBYPDGXQAQETKXQXVJ','SLBWUKN','FMRYZSGCXQEQCGQPB','TNCVXGBSPXGNTDHET','MNJ','VAESXUHIBU','VUZRSYLATSEAW','NYGYKHJW','IAHCUOPIMEYPNZANS','SMPHROHJ','QKTHERTDFBV','ZEZZJNFRM','PAMPJCXL','AQBFZZQMNXIWH','MQJKYJWJLQYWIQIC','FADYJXGWRGGQDLCN','OZNVSOSQFYOTAG','UATQ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MQTLVPBSVWYUIELEZRN'))\r\n%%\r\nnamec={'OKYXOCHXC','WUCHNGRDZRBUAMKYBYR','KODKGIVSKXHNQQQEZKYZ','TXMPLWRRRTQXT','EVSLHETL','QWQHMKVVAD','YWNUODRFVUEZKI','BGCXWXN','DRBMONETDKXMHO','MCFUKSNOCEHQAK','JDBVKORRWAFZR','WDURIEMNLUFO','ORKOM','UKKPDHTHPCKU','WRTRXH','UEXFBNJNDTPKJT','SHDBQGVDATZNJGXMII','NSYSMFHI','GYETTAU','RZKRYICQAGF','WPPEMWES','UPJCPCZRM','LNGCVBZTYRJOB','SLNJWLEONBSDEX','HOHIMCTUIE','WOUFXRTVDKUUXBNYIBIB','VHGULPEBLOVIYKJN','YOSOQLWSHMJOK','SRS','PUJVLJT','TUKDPQAZARHPGMIUWR','CVAYCJFVZCYKSZGLEFBL','XPMQDN','EGVIOVX','CKWNOBHAIYYDCTQ','Q','HAK','GCVVXCLI','QJHHZXKTMU','AT','KJ','CM','XBRMN','EPSLCDVWQJMHJBLHELT','MKCZAUASYPSCSKK','WRUPHXMGDK','JWTLRTXKR','OFWYPCFLZOKSSIQN','YXLFUYUAQSGOXABAGAD','HN','RVB','OYN','MDGCWCOIHSAIS','BNAIMRK','SMIEZURUTTIDN','YVWMOWXUXGMXZ','LFSVJTJNIUYRYIBSV','WFIP','XOARJRU','LPQHDSU','IP','Y','WEGHMPEAJSWSTJIR','LYPLZBJI','UPNZWVOSSHKRSURGTVAC','WZSUALERZ','BVHUJHTUQHKNVRGRLE','GZ','CHMOLJUBXNCCOFBQBHHK','RVJSAWDMHDAEXR','RGLCMFSFMQ','NXTOXERFCYJYOFRBPA','MXJJROKRCQTCERFUSEP','AGLCGLYEAG','DCOLWJH','OT','CEOWMU','JWQEMMZFSDA','JLFSLCJRADNG','CTQCBVGZSWAZAMEJP','HJQQJT','QHCQRRRYOF'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SHDBQGVDATZNJGXMII'))\r\n%%\r\nnamec={'NGLZHUMADA','AZILUVGRZ','WMNBT','GYSTYVINKIECZMNQZL','ECXQTL','VWRTULBMJDO','H','FLVVGYTKS','AFBDFORWDIZYJ','LRMVQUDKDTFILNE','KT','COTJDBNMWYLUVWJMUJXS','TTYII','XHYSDPTIT','HOPTKJHZNOIIXJI','YIVJUYGFB','XOUJPTEEDKMLZN','DMZTUQVCPMOJTRCSXWTI','PMHQKVAJRMFYNTV','PFCFOEPHTFHXUT','QFKAFLRJIHO','XFUACXQTNPISWBADXJ','Z','HSHHZZVOKF','UIGBVNKBFDYA','DBOMNWNRYE','EXVHV','IUED','XBCRBVM','QPDIGQRWMLFCTFE','CZEIKFKXJPNZ','QZHYNGQRELFP','JQKUTHSVFJPGYYZGLYA','PDZYOAJ','CZZIOGDFEKVCR','HDWYLVTGHZR','AMEMKIIBFM','HGBW','MFEKMJAJEFBQPRPA','UDRBQ','KBHPSSTTPQCXULJN','JVSOGFJRRCWGQEROTD','NSYBMKZ','JNETACZUZJDNGJDKPQ','DHQACXDZOVTMQKRCBFEH','EGPZFGLFAZNKQCPYMOLL','EJNWQYTPCSKHROERKWFF','QNHBHM','LPQPYVADQTSKURQE','PBMC','BSZNGEOPOSEZOYTXDX','AZAFTKXUUSEIRZNXKBH','FYTLSIEVYCMQ','FVQPOZYGMTLFWMENJC','I','QWTSFHBPIDNGIM','TPL','DYXTKYWIDOEINGXLMVLQ','BBPMULS','SUMCQUFARFFPZDVSH','BKMRLOZQEGPPYZF','TOYOGVMV','PFEOBGZNXGKOYQVBL','KFMVTGN','TV','YXRYSBJQUUBGWJBTG','LURDAGYJXMY','GMZ','IVGOGHE','NOUDGHGPVT','XSLETYJZUXBSWG','SBKSW','Q','WHSPWGNDCB','KKJDSBRQFKHIYHY','XDHH','MLEFRXPCDXV','YJWCGHSFBLYPEXR','EVNOGUL','YAAUJWLIRJHFPIJEYQI','DQOQXTBBFXFKYUWYXB','AJFEZVMFYULDLJS'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'DHQACXDZOVTMQKRCBFEH'))\r\n%%\r\nnamec={'NYKFHEYGIWDRNR','ZMFELMGVPAXXYYSGE','KUXLNNNRBRNGFVTO','FCVXASKDIEOVW','KGAXP','DOGJMZWJGXMA','WZAZZEBRSFTYMKUHQT','UOIAUGP','WOVRO','NKKWPLXNP','ZXDOBY','CQLIBFYTM','ZUIFAWEQDTVLGQ','JBTZVVL','WFAVVTDYPPZMQ','QYNPYDXMFQBAIXEKHB','WWXIIDLQVUK','RRUNL','SRKKOARPCHQWIPX','TJYBMUSCXCSL','GWLQLGOZFAKFI','JTEDUQQAIKYCYF','GNKJBIXFQHLY','UFG','ZPXZXELZZJMAMKNO','PWFEUVLBHFNMLUHOYLKF','LFLNKCRS','VIYBFOJL','QLDDNBCSAFPLSRHUFS','SSKNUIMRPXH','KJAMTWR','DFGDRLVJKEVSJKFQD','XWWZXONGQBCN','FXKSWCTC','DMHNSYQLJAFYKEJNA','SA','LKSEEDCLKPVYYYUDSXJ','EKFXCNEEBAJAV','ZCGKPDJBNWBPRDJ','NOP','LLUMUMZQHXKEGNTTPN','YQNQVBQNJRWLMIK','XM','TLKAAIHFMCNSSPMY','RWKZI','B','KPVIQOIPLNRZBNI','ICTRPGEPIYQMF','USOYXNGXPHNHPKE','TTWXBSMFPSZZYXM','HKPWROFP','UOY','ANFXBYIFVPXRDJK','JREXET','LDSZECJLWCBHSQWTCAV','FZZBGXNBEA','I','WKPMIMHQEEGGEYTGAHB','NQGHUHVZMXRT','FRMNOJLMFCLUJENO','UVDTQOXJBMHHBQ','OA','S','IPYE','IR','WMULVFEAIHFJ','JPQZZDGRBAVNBAG','ETZQWSOAZMBLVQ','M'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'WZAZZEBRSFTYMKUHQT'))\r\n%%\r\nnamec={'YGOPOXMMGZYEXIZJ','GRXPDHIVZADUYKEB','UWUCUPS','IIZZSDCF','JIZJWUBZDTFTLZOCK','LKLGJWEBFOCEW','WMLRLPFZJHU','AIARXBYZVMVVYMZEXKJ','TQAJAEARSFT','HJUGNDUAHPEX','NDGVDH','EOSWLGTWR','SABZSXYDR','C','YQDEEKWVNUKURM','LFEYIYLUYQMDLILT','CYEFWERUNWHYV','VHNP','ED','MQAYYWFF','AKWOG','EOLJT','MWSITBYMRKEOQ','FIUCWARXBBC','MYDEFDYGXICH','MMYYGQVGFICUAXCRS','WWPULNFLHM','LQNFPWNT','CKVWCGQT','HDBOPMTUYYNHLTNSLC','WVZCNJFLSQRMCE','SUKMDRPWWDZY','SIOUVYRY','EXVQO','FSHXIR','EVSTROF','YNUOG','VKUGYGUJLBIBRDF','QYZDIAJCOAIKYXJOZ','UQNFNOOIUUYOP','O','IWVIYUDSV','RIAEQMJQ','JGXPONWN','GHWIKCVUUULEQFFVOUTE','USATQADSTPSBWMSR','OBBZWUMHMXPJ','PDS','WDEXWSO','ICOLI'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'GRXPDHIVZADUYKEB'))\r\n%%\r\nnamec={'VYH','QFSOIGSE','OCPFJTROG','ZBHEWWQ','LZJWJJFYDSDITO','ZUNUNN','KFNYNQ','IRKSHPFDSXGSNUOID','VQCISVNNHLNRJPNTXVQS','KRPEPCPGLKOJEOFPUOQF','UKOBUYSK','RG','MVPPBWGDTLRQSAFFUD','AJSMEGOQUGUEWGDWZO','MDBEAYZQREADG','LSXWSUMQXEMAQZAUZUH','GQQ','HJNBCZYQGGWZEV','MQPZDGCPEKYRDB','UZT','LZMCS','TODEMUWPSQBWS','WFULOCXD','VVJZKPOEKSOTOGVUSYK','EFXKO','NY','LIBOUCDINCXTPFKPXG','MDEXVSEEMXINRWKQNHIA','XFJDVCKCOFH','ZEBAJNOX','NJUVIN','O','TRCVTEZLWB','VZEFSLLUXYUOBS','PUEFRCWUOTX','KOQGLFROZL','PZIQXSABZKTASZMLZOR','VIANZLODOLNYKG','FDYXFKCIQBHRJAWLAC','LHO','QLRGGCEDMLKOHD','YMOJB','HBLMFTLT','TAL','NVXSLF','E','CVIARHWTKWIEEB','VVNPJYU','MY','GHEOHZYPRPHZLPP','HGATPAG','WKNRVYBTRFHCYGFVTU','W','IHSGEKQRADAZGOFR','LGZZZHRWJJQ','CMKVAOWRDNXRJWKDRU','OMNXOBJD','NDFF','TTMOCY','SUZVPFSGODKTYU','PLXUISCWQ','LKRABEVIJJOP','REBLYVBBCQWDEYW','KGAVXAOVWWOQLUTFLVF','VIEHXWRO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'FDYXFKCIQBHRJAWLAC'))\r\n%%\r\nnamec={'Z','YTZFCBEEJ','IWSMGCQOIKDVQXNLY','WTZWBQUY','AGSCPCCZWIN','WRBBVZFW','XPVFODFMOAICPGQXLYPZ','AICVNQCH','AGYSIIQVXOIX','QTXIZADDYKEQAZWQW','YKDDXSJXFQMWFA','WWUZJWWZ','RSBJNRUQMNWGWPL','CERSTMDEXSWDT','IGNY','TUDREACBEH','IGNSZYVWJBGMUUTFG','QSDDOZQFEDR','NEMNYZLYHAFWPPZKM','H','LLX','GZDDNQCID','CKFXPTAAOCWSDAAL','PBDWR','PTSTYMVFHKF','QVFCNZYBKZCWUYLBMWSY','BVNEMMZRUJHPZAR','M','PYTRC','ZRIZFNHXBRFK','MFYROLOESPHWMZJ','FSCXZYPWBEXZEK','HQ','VDMU','QPFUMPKPAICYPZUQ','FEZPFZYWHCTMEQYRXCXJ','VVNZAEBZVJFPYK','NPPJWNGYSTPRYMNZQGM','TWLFT','YVDHKL','RMVASPSAWYEDTUBYUQR','ELLALVLJ','XWBELWJUECJFSSEFXXJ','XMRVSMGLIFWEYQQ','KZSOGYLDSFM','UYYRI','VGPLZBXDJGOYMKA','WDRTIXJYRSYVJAAMRFNV','TFKNJUFIEBRXBDD','MNUXMYPQODVYJVPW','M','QNKC','FCSKO','ZILNXGNWQONPEUO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IWSMGCQOIKDVQXNLY'))\r\n%%\r\nnamec={'ADAM','BOB','JOHNSON'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JOHNSON'))\r\n%%\r\nnamec={'NQKNNWHFEOHSLKTNVFLR','BTFNVWMDRERYJVAIT','MAZTVIYYSUSJJXCASTEF','FGOIZR','SIVFDJRBFAVOPY','EFKBLIU','WEKVXIWONZQBQJGIAN','QTTWWVZALMOCIY','VRANXGABHQKFQ','KKTA','LOMGOQKUSK','KCXCH','IAKHQMFDP','FHIVJHZJRFMBHGQJ','ZKNJ','BGR','WWGKGNTFKG','DTVKZAMA','OOOXPAPQOWFJVSVV','DLXWYZJYHKLNQRHODVLF','EKV','VENEYJPJXBEDEFRVRQ','MHSXMA','PNGSMCENJF','KBBFGPHXYTBMENMQU','OSGSUKBHICIJAOQVF','OAQPENVJ','DFWDYEFZMD','MFNTJSQYK','BHIOQK','ECIFYYJTWVQNKY','KKFMTFFPKX','KNIPHCQTRIFWKQVHST','QSJNXGCJRZSTISIVNTAN','OPNAH','K','COLCJEA','VLIFMKSEYFSJSSIJELR','OTCPPCEGFMF','RTQWFVCHJVHKMMNVODQF','LJZQNXVWMBDPBLRANAH','ELHSEBJHCEYPTH','CIZWPEZSRZRCAJSJRNVS','YX','JEOJPVAWRZCENTGFKI','TGCZ','UINFPXKVYAUVEIQEVJDU','LBJNSEBDTDRN','PZRGVSPLWGUZZKG','UWILYJONFBSJJNS','GAHHQY','P','EGMSUUWGDVI','QQWXQVOPLAJLHKHOO','KFRXTPQO'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'JEOJPVAWRZCENTGFKI'))\r\n%%\r\nnamec={'CSKVFETS','LBYGZSQJRQQOK','YBCUNSJGVADXYVV','JKJTLPGXMJCW','X','VCDMDU','K','NMVCXLJVSDZX','HZPEQR','VUHKKTVMLEYYRFAXYRM','CEQTVGTAVR','DRWHHUGAFBRS','U','TKZKQXBGEGZITHG','VNSDLKJETHKDUUNVSMCF','N','TLPDQGGPYEBGTST','JDWFNEASRN','GZWBLS','BRPFMTELBWXKBSDBLQE','PLQDVQIYOOGSJCCHU','ZNY','RKUFRMQEHIMDQGKWM','CODFQCBSEVEVBQTNP','VBALOIRRWMWBOPAL','ECPPHOWLMLMEHPSI','WOL','VSHCNE','MWXUHAOHJZMFZQZW','JZZT','YWTTXUENEJZSJFNC','CSJ','XTPKGEQWSFVDDEBFS','GGHTAVOKBAEMPGKMWCWT','OKTJOM','TAKRHJVJCW','OMYDES','QECXLKFMXRZCZQDIFAB','WFFRKQFSUHOFLYKPPADQ','UDVEVWPNUNWWKTYY','SQZZIULDKGC','AMFFCSTYRREGHWHISPZF','QJTPNND','ZJYOVPXRNAPGAPQHKWXX','PIKMVOCQPSFMYSTS','DKMBCTJKAXZSQADZ','IIRKRCWGPLSD','VFVOICPKCJFNZGIMJQN','AMRWSCZGTYRZCTLMOMK','IMJOZCRJLJ','FSCXCZVNTKGIJGGNPUAE','RFTYBQEEBEXDVGQ','YNWGOMUNYUJJ','OFLBGTFCUBR','OQBRKADPXKFRIGJX','UQBJNPNOVVIJCB','TIUWNLTXURCFUXVVYE','QLXWZOWE','OFDGSZLOELBHINWFIOY','JYOBUWPSULYAGFVNCZGB','UPZRXVXKUXTHHM','VUPDBBZR','BMLYPBJKKYXDE','PNZKJSS','LLIKKRPDSGLRV','CYTINFVIZYRFMW','XWSJZIF','OQJXHCYWHT','HOERTQJBB','TCDLCIAQ','JCYEUKSQ','HRVAECIN','CGGVABCCCYKTMFWYQKLZ','EAWICWNB','LILXC','ZTYG','DXTJHSRLSJMUCZNSHM','SNCWCSUJQYAJFJMPQPY','SPKWORDMAFYXRZBLZLQ','IVXXA','E','TOHASOQMXLNEHQNDRTCZ','MOJDSIWHOVHCNJICCOBW','FJAYM','FQBOLLPTRSYWPDVPQV','ROWOXWA','JGGCMRON','XNVP','QGNPCCLYR','JJYKPWNKRPWOIFQFPC','AVNYDDWINQ','UJYKLNEYCNUUOSMGXGBX','XXH','ECAFLCIYVDSP','QWUWVHGAFZCZRHHBBOY','KCAYQOUNTDD','B'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'FSCXCZVNTKGIJGGNPUAE'))\r\n%%\r\nnamec={'FKIPG','FIEOUUQP','RN','MPPBIJRAXYE','CCVHLSNXIWIJBNV','JGGHIQWFKSAGPY','GBDYGYDJYFL','JVZ','IJPSUPQF','QDCUUIQONKOEZZTVFKJW','SHAOOFPBJ','VVKFJMPMZOBITLREWDUK','ERFTHS','IXBM','QOZQ','MMJCPWBZ','FRCCUBIFBBGANTRKZMSF','AGTHUZR','ADYQXRZUSSKYQEBOJKGP','FGLAPUWMPQ','ADPUNERYENYAPAJZQQD','TEI','MQ','CQASGO','YAEUN','UUUVHSHXVAMRANGMLOH','YOJIIJMUXCCFWX','KAYW','LW','RIULPYD','FKLNNZG','AHYVKGPCF','NDDRBZWLGMQUH','SIGRH','JRHFEJCYHGH','BYDIOZMXPMD','FNT','OYVDVAHHZOJBMPBTCO','JDFII','TFCRVXUEPKLPFYYCKEE','GWRLWRLWBFQLKBV','ISJDFYTZXKBQ','MIGDMEKZMV','GETOPJ','T','LIGBBAJUMKQWQM','MRQ','XMHTRRIMUQ','JTSBV','JNXOHBPGQXZQCFYHZ','DOL','D','KFN','GSCUSNZPYPLCRIQDUL','CMNQWSWBRCD','MYVIWUXI','LPEXAU','KOJPAX','OZNRUXDHQPPVLISOA','LCOURGNNV','A','JOMVNGMJRCRFIRNTLTJZ','EQPXQG','IMGVZ','YBDZQIEZNXHCDKCGZR','CLOOK','CYSAXVRBVVEHZCPR','SXH','ABJOITMK','GKVTTWKLLGSEUONCYBV','DWFLLRVVQL','HWNWYQDAXIHJCB','DPHFBLOOYAZKARPWDBR','TKVK','LBYSXXYMJXFZGK','JL','FAATKTSONFCGUOLIPFF','ACKDN','OD','HENGYHM','MHFCTBIBCQHUUCWXHD','LUHHZDFLCSLORQIGSRH','Z','TPNTVCTYOSXBOUNQ','Y','RKBYUKXCFVWMRL'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'VVKFJMPMZOBITLREWDUK'))\r\n%%\r\nnamec={'PNJLGCFVJGHGWO','UYIONSVIG','CL','HUESTKNQX','SALYWREELNSZBP','BNJDZJKHOUSQDFKXCKJ','TNBIT','EMFHXOJXUALHZI','YBTCFQQZ','EDFYSBGQGC','PZZPG','DPLIWQLTYGDXJAR','XQFVWHRH','EPBSQBHQPXERQ','MKL','TAFGSLFLICJXG','YNZCPIXB','ZE','PFXEDL','IJIEPJV','NOHRGSWBSDZATZXPEYE','UTORC','XVIWAUSOTTYXILP','KLMSHODTREWLEGMEAKQM','BMHRB','UGFMAYIKPGKKGOODGQ','SMNATWYMABFAXVAZHBGB','EPS','VFTCJCYYSSYPRORKID','JHBQIAXTCCVXHHVFR','ZZLQENONICOQDBEEBTX','NPNHOUUUIIZPTLUY','ZDJLXCPTDEMUJTEQ','YHQYYTNGWZAJMZH','WY','LTJPKLFOBARRYL','RVQKALVBY','DKTOPDDQ','AZMQGL','QCPSYFPYQDHGYXAEMG','HJ','YBOHRMKQUE','IQOHTONIIIEC','PJQZRCC','OEFIFNNE','JDHEBJKIKGGAZFFA','NHM','VSXQHZLFCPMWWZUYVPIB','HAOSNCEVJDGBSFNOVSLP','GFHEAVXFPT','YSWXTKZRYXQHLTPNQV','NNRKFIZKXOKYVDNYXID','XTQABKRPUW','IYZILFCRELKHZAZBLKR','LLKSWMIAD','KAZJAGOZGIZR','FHTUHMLKNV','ITAHVAFRTDBP','VCNJOSINAUVMBXZ','DETK','LHFAKGPZHUIIETIK','XBAQSPFVUY'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'NOHRGSWBSDZATZXPEYE'))\r\n%%\r\nnamec={'SPTOMHCELYFKFSX','WINRFF','LTHAOJDIFHHEFCBPZD','RAAHGELRLLOI','PDRMKYDG','FHHWZSPSTXKR','NEBYKBDR','MVHGZ','UWNHIZZFDFQPDP','HQOKRJTOV','VS','J','TKYOPUXP','BEZJKFTUZDLGQBML','OSGYFMB','CYK','UDHMGNBAIMJ','RVCXB','RGNKBHEDHQG','XKCEUASFAMWNHPOH','NMEGU','JTIHPXRJWVM','UXTUFDZMKBMOYAM','WNAUDPIMVLMFXFQ','CTAH','CT','INJVBQXR','JRBIIEMGJW','MMEL','ANGNWTDYQTJDISMB','UXDLVHXRSS','SXOXQDTCTILOJWCL','AEIKGXTQEF','LUNOBPJCKTVNWANST','KEIVXZZUVXBDI','OEGDI','TVLQBVZMSWAJFPC','NKTGDWFEQZON','FBMAYLMQUSBW','PZIEBETGIRXZ','NKTPM','ILYTPLBDMPGTKPYMTNK','WZWGAYZC','EKLVVCOWGCFMGYRQNJM','IMWZBYZFG','RZMXJTPHRTXVJNZHSJD','EQWFKORZPK','LIMZG','OGJNP','I','ONHKJCTRSHXHQJOWX','MEUJMQQLV','BYXNMK','TAQPQRJKTWKZML','V','DMMDGTLE','REA','VRXWMNMOJQZJX','EHKSVVRZFEVGEXV','NZCZJDDED','IH','IJTEWCNJHJ','N','UPMHRIMYEQQRRZVLAE','F','FEKEQRQXHBJBSV','FJAA','NSURBUOO','SQVEDH','WGUCHJUXRAPJHGWRBKIP','DDCQXSU','AOJTYNTKWS','OGEPINA','IZTZQJ','AKSGBUDUO','KQBCPHX','UPWLLPTVEQNGETYOTB','VRCMMJATCBSL','VX','KGDSLBPWAJHLCIZUCH','DNG','AXBVUCA'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EKLVVCOWGCFMGYRQNJM'))\r\n%%\r\nnamec={'IGOYRFKIVTERT','DKOHDARM','TMIKMYTDSFH','CSGTIZWEFDBR','KADAEBAPFYIYGO','IQMGMBMQLTWUWC','RYRKYYPTUYFTI','QCZFOSRARULJLZEXMCW','IEJYJY','RKCMPQAZRSHUTKQPUGNV','NZEHCBZTDXKOXFXD','NPPALM','KZAOBCZ','GZR','BOZQSAAZPVZD','UNUUTLWODUMUIDS','JFSTFKOMXCBS','JXWNPDGVSZT','UMAWLBCOZUPOAIYXEQH','LFDKXVWELNQDK','PDCDJTPREPZ','IVGPDJUMGUE','XJK','LKEPMYBODR','MPPPZGHZSDMEHBQJBV','RPCVEXLWWPHHBYXWSUW','TPJEKMWTTYCYJG','BVPBOKODUYWCQPWBQ','FSZH','NCJWIZ','VCQGMOUIGWWHVPXE','L','JKHOMQMDNEFAK','GWKDCDMJQYN','FSMYMUWYPU','AOOYMCYLVNYWK','KKDOPSAWIV','NLXFXCY','VKFODHFF','AYXHMQMHKU','DKNUGCMEJL','QQFRLYDQQEJDVTKCMQ','YMJZP','DCFLDAWFITJERJEMQFI','SJDKAPWAEREJZ','UFAKJ','UFCVECPWEE','OHVLIZVXZ','R','ATUFSOTWJEP','JZCKJKHATGYHWY','ONJUBQJQZF','IGSE','NPUPRTJQHYKIQ','JORJFKJLQLVZELEXNUA','WTHARCXT','YADUX','BUTHBXDQXRIEAPC','AWW','QOGEM','C','J','LCFAVHFYMSYMK','GTWZZSHIQ','KDVUBLNOSKNP','ETPUXRV','MQYBPYJJEMRSFBTJD','RWVHLWYCNXGWJDJ','HGNQQSPJARNYEHCETYU','ANTOWTNRUWQSDF','SOPFTC','QJEMUUDZMIPB','CKIQNAB','K','ITAJGBFKW','NRIWYPM','ZUPWJOCSZKQDAIEKKIYW','GUZV','QQHBBQVPSCKKFVT','TVMTHCDKAJWSW'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'UMAWLBCOZUPOAIYXEQH'))\r\n%%\r\nnamec={'FSZESYIDKESTRMQPSS','JLKMFOSQF','XSBMEJHOGEXIMA','AJTVMJGOW','MTFXUJVQEEIN','MNXEOMSSEOUKURY','AN','XZHMRQQGU','TRZKZBO','UKKU','THKLUBIIJRQZXENQYAST','CYVFVXRWFYDQ','NPWCNJ','EFAUAA','T','YOPBR','GLPWSLDTFMV','QPIICXOJWDKJPI','AXBDUFDCCHPRQL','GALFAFUOOERRGD','TZKUVBRQZMXKBNCINF','FKZTRF','NQLYCRQKEOWFDUC','AUJTLFQFT','QFCLOKNSBJCHVN','QDHZHFPSDCPWXVE','BSVCTXXGBXCAKU','JEMNZFC','CFJMEBL','UJSNCVNELBNFCUDODMGO','ISU','LXB','DUODTCGVHKSW','OUDTEGTWSBEMYPG','MBXGAOODYIZKO','JSNQPEIY','ZVBBZGZTMZZPMXXXA','YS','HEAVRWFKQWQLLRNANXGJ','RQMGGNETWSYCRTUKLCJ','BOEVUNAHWEGJKRBUEJVH','DRPGWQSPAWHMGTDZSNF','KBCTWJT','SRZRKLFZD','YPZXPODCDBANCDYREO','XXWCZZHNHNWXJHMXDO','EOCJPOLM','EXWVAFTSMY','F','KRTFX','BADJAHPDL','IVVLKBFMBOQVTBVUB','UDQTK','AJ','IIYAWVDYOIGM','V','XCWGXPBFKJQ','VQACRASJWBMQ','UPUWKP','YWPCPMMYDHH','BYUDKVPTHETUYFQQ','CSGAVUENWJMXMDIXCFTV','NNPEXJBWJOTEXLNMAG','EGJDMVLZGDQKZDSJY','WCBZDSVJTFBCCME','IJRJMXXJSVKNQUESSPXG','TFFVIKZJZAFBJUZKAI','FYDB','NRFTYRXHZZZQF','IYRKEAOAFTXMG','RSEEFDWXAULIPUKLUHR','EHDE','CIULRIHVFZVPD','KJANVABEAIWYIMFNE','SCIPMSAZVJ','EXSTWLXTF','YC','HGRIZZXHXEAKZBVYQT','BQRYGORWQPVWGIBBQ','LUXVPYULSREP','KDYSKHKQIDJEU','P','DGSUSJBJKIBQE','TUSPGYQCORQ','PEF','FYHFFNWCMPBCGIAA','CGOLOTDDPAAMZIJV','XNDRRSLMYLMQGHWM','HLKGGKGKFOUSMFXPWLZ','PMPN'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'THKLUBIIJRQZXENQYAST'))\r\n%%\r\nnamec={'ROVISHNKWIRVFYOZTG','PICZ','GF','XEGMHFSRFTX','SOFGDDVBTDOWBLEQQBWU','IROHUFREDPGGBRXUFZO','SZSFPXMWFRJCMZ','TX','VVW','TTVZCJYTTNPQAUI','AMJBBCWQJOUUD','PMCQ','PCJOYAWISWUQOW','GANMU','HXKE','MUMUOVEJVABVLQEACK','IWL','EOTQBINUTEP','ZHARSQNTKXDIBTVWZK','MDMDQZOGNYGGDRW','GDJJDCPXUKZYOJHXX','OOTB','ZEAJ','EOHIRXCJZUZCSX','RJBPDMQQHNII','GNCGVLZ','OEBDO','HYXEZJHRQGAQOPT','VK','IQIMSELNLZUFL','AMYCA','DSDXJQZMYMUWZJFGLIM','UYTW','LLQA','BJPVBBE','X','BUIANDSLTA','CLHKD','MNMBOCAGRVKUIKSV','CYCDDL','VUWTHN','GQJGTCSWRM','MKGKFJNUFMEZPYKE','SFO','SQFKFPXM','ZSATEUQQQDNCTPLDCJ','VSSBPZQOLHNLSR','EKBES','ZDVCMEXAO','PKDEYGDASVRMRFOQG','EGGEJWXNOWJY','BWTNFXXDJ','CO','IKRABUNQM','ANSJAKLQZJURSVU','VJCIJ','UOKNFBZIR','EYNHPDXHCUIUQ','UVLCBHWEYNM','ZI','TVZWTEEJVGJ','CLNXKFUODS','VZCJQAZHFVIUAJ','IWSKUIYLLMOCA','FBRSOXGLRGIT','IDSSXEFAQLC','FJWSCYRVD','BJUJXUIJQMO','URLWCIH','BOTVBWWLYUO','FALLJCUWNWWUFWWLKDJY','IQLCJIQINJLZSFQ','OMUTEEBHCBD','JWOM','WB','EXRCBRWAYEMNJQGIH','JLESZSASLVTJ','PYARZJJRDOA','PIHXQIYTME','XYSFFAUVWAICBZHRG'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'EXRCBRWAYEMNJQGIH'))\r\n%%\r\nnamec={'MCQZORMCFCE','YZJFNXKRLAFWI','VSTPICWP','JNOAAMOXWBMYCECBRUVY','KNRBWAKNG','NSRCKZGETDUM','DHBGDGXIMOAP','GSDRFXLH','SMVCUZNPCPVGNHVLDVB','OHLLSTWXVLZ','HBTJICHVJFVAJX','YTPXEQP','BGGKNUVOUXWLZ','QQLFZFNLQJ','DRYTBDIDQYXKJPVEAMHF','MSLVRMAMA','CTSFTN','JHTIO','N','CZJ','ZOKFTLCDWW','BDPHMOGBPUEOP','DAAYT','YNJJJXDDTKBZJDKV','AGIWRLWRFLHCFMDGWKZQ','RQMTUDTXTSKW','UTNTWKBZRXOTK','KACSGHKKTGDIQ','XKZMXOQONBCENEPW','VWXLZ','LMYEOLJISFETJKDXX','TIGVVDPY','DCTCRBDRT','VPWEIZBCRBXXPHABRZVT','YGITXGMUIPGVJYOZ','CVZPJREYDD','WSVNZZKPDXKUY','TNZKBKT','HFNKHUKPPMXKEQMYCIN','KXUEBIDGNNFLD','NTCSEM','MZI','ZWXYR','YNHDQNIVKTQFZHNBL','NGFCTZNO','TJJSERXMIDYRALO','YQLNVRSTLA','NWZZXFFTW','CXYSKZQQPC','YHIFKIFJWUFJFCOZQN','JAHLRDNWXD','WLGCULEEXJFDTYTZNZM','MKW','PHASPWVV','LZVHSAMJZCDOTIFOUI','WWRHSRHCJ','T','PKU','CYBEHBJ','OJBG','LGXXAXYVFHHQC','OVKHZJIFXOOQ','ICMYMHPROGQD','SQKSFCVMJHDRFWL','GNGKTXFEDNYNCW','WM','NYOMUCJMNDBTWDOO','KRKFXMTEBJJZYNPSX'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'DRYTBDIDQYXKJPVEAMHF'))\r\n%%\r\nnamec={'ISLN','SRIFXUBZGWBYHFRIN','SYXUWQKTDINJFGVZRXXB','RBWEBFPTVICNRWPSY','BZZQXYJJZ','UJXWGBDBFCKUSJIMBQ','P','ZLKBGXVPJF','KJLDG','OYXOAMBPYMLZSIZ','OJAPNDNTRCNCLQSIQQU','XGABKPCNQ','FXEJGXSIGVRRRQZHSOSG','WJRRQDKM','JFORL','QUZFUBIF','PMJOXFRZFP','WSHBJEABJCR','NYJWX','LMQIDEZJCJYVIZ','FNAGWWJCWSF','ESQHTLNK','QLHHUYZVXWNYQC','HQAIOUAANFMUEYGZLGJE','O','GQIYYQZWMZTPTPIZNMPR','WFJUOFKEIPECBUTXCPE','WPGWKTYKZ','WJBCAF','HKMIWCBZJPX','NQXCMLXHNSCFU','HUBJTDVZPMQZUK','DWGIDVHQ','CVVUDUWPNLDJ','HFRJNS','NOUNAVHOFEEAREPCRF','VOYSBMTGXMQZACFFKP','MSPJXWH','XZAONDLMLDLAJIULG','RKQYTBQSAPERICXHP','STAIWDI','EUECSNMEHYYM','BIPJKIIRSGTWWRTCLYK','WBMKUAQS','FODMQMBPJZSDFPZXQ','NMJQDJCV','IXBOFYVOTJSZQFSZNB','BFWRJXMWXUMMKF','QKHIZJFNKCVPZJ','TCEIQUJWEOJPVR','KHX','JRRNY','GFWAJXINHAEPHLYFI','ECN','YAYKWPLOZE','QJWQ','XGWAEAFIYCOOSGAVDX','GHBCWJDPDDTJDLKEH','B','ETUFC','UJNTCP','MTI','WTX','XDRCRRDXOPFTRNBUVE','DPV','OWWX','KEUTWY','GJKRXKXLAGPZJAQ','WWIEKSIAAWYUDAN','PZCVKWDFCU','QSITT','DNQJZPBJRIT','IN','FBEZPMPJQPQK','FMXEFYVNUCESKJ','HKQZUKWTFBPCT'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'SYXUWQKTDINJFGVZRXXB'))\r\n%%\r\nnamec={'NENLZQOIKIIPVDBO','PHKZPOEAQQVMCC','LAZADBYKWMHVGXONHKOQ','DHAGCRYRMYIHZCSSW','RFT','ZGFFOYIVQGPIXJZD','VPBUHKZSXFRVCWSALF','NOGAMCBPYQJGPTBDHQAY','C','VJISIBO','XSTTTENFNLMZEHCV','TNCCXGDLGAEVZJOJKO','QJLAQFNQYSWVDUYGT','CCDDRAC','PVFDWQDAOR','IFWSNMCUEXVHCVCWP','BGFUOILE','AE','UZXQKGPNRFSYCT','AQPUWXLETYHUWB','R','SODDLNI','HCLXDIXUXEQMMMKEFMON','E','EHARHWQJ','JMWJ','MCYUHPCTZ','YAFHAJEINPSAYVBOLTSN','JMDBQCRQHQIIUF','RSXKKTEBZ','UNUDWD','CUGSU','UFB','OMWLOYAKZR','PBILPD','DVYRGUFRZBLSMREFAW','HPPSBS','CGUXLV','UKXUEKZBAZPICBXN','MUUOD','MVRDGH','RIHZLY','LLLTGMNTRBTXODFHM','OGWBDX','HEIKNBVL','X','DNGCIMBHQIVHO','FPJUEQZFEKLNIE','EJESIZY','IXONWWTAG','DRHJZDPMLTWMTR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'LAZADBYKWMHVGXONHKOQ'))\r\n%%\r\nnamec={'E','VADUTZCEK','QTZWFSQEKKR','XDOCFRCBNYJGO','REPMDAJN','NXLXZEJXUPKOICUECCR','GYXBQDOZIH','XYKUEZCLGJTIPUJUE','NCIMJMDCGFOCBRN','SYJBZKPWLP','JRGWHPECSCACFBLKW','FVIIIJXBEG','GPGOVYRBSREXKPECPBXP','XPAQOYMMXS','VIMFYVGNIKKSCMZZKZU','ZCLDPFN','SOJXIXANXKMEUOQP','GSO','RQMXX','ULBWFKPFPIHMEVNG','BZHPJQYFJUQWCROVENVD','BGRHEIFQJWCGU','GZVY','UN','QSGTN','NTLUQJUPOYAXT','MRVDDPPJBTMCVZO','PAD','PKCIZTXHHGCCVJLNCXC','ZYKJRBWPRCMLKBG','YFABOIFTKVQ','PREOSVDIIEGAUDNC','CUIEKVZHJMLPXH','MCNHTUTPTCJEMYHIEV','GBRQTQPYFSHCR','WGDEJNAARRAZNRFKC','SNWEHTW','VBDGH','CILYJLBQZWZWTFYZXAJ','DGLEBJEDMLNBJORMTRJF','ZFNOFDSLHWMQSDU','OKGQTNDILIVR','ZEABTHADVMUKH','DWM','IXWDXEDURNPMRPFGMCFM','TQRVXL','HXZHJKDCGGPXTAH','DFLFLPCWXUNIBQRQPS','SUCZRGT','NSLXWGZOHTAJSQSE','GXMZQNFFLYIWPX','WKMVSBVLPHXNABSRX','PVJVSYOQQYAMVN','YNICVYRXMFCF','RSZJFNPOV','MVWFQMKQOAI','RXFOZDMNVBXO','LGKPTZDYLQWXFUVTIYY','HPOW','XPDXQDBESSMPBDJ','VWFGGTDMSQQDZOWITP','RPSXMTNZDK','CMHIKDEYXMNEDE','SLBEPVRCQZSO','AVSXNZSGBKDVGQCRJGY','XJU','IHJTZ','EIQOOIHRLXTBDHTVWQAE','T','NJWFFXVUQCSCN','MKQZCCRGYGLW','QXSVLNTKEIVMAS','LEDNUMX','XIWJBKXWND'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'BZHPJQYFJUQWCROVENVD'))\r\n%%\r\nnamec={'MBU','PKVORAQRK','QPVRFOM','OHYGVGHL','PVVAVSXP','AGRSDGYGGJMFDSKSA','ZOQOUPCGXVGAQDHKYFID','OHDJIDKZRJDYWKDREZKN','RXWWCSBIZ','LV','GIQPLKWTRIQMSKFWZ','YNMCAFJMYSJABNUBGGNY','QVULCO','HJIZGEKUOAVOAWTNU','LEORUFHX','N','HOJYNFXRNYIT','BIPGVNRZHYZAQJX','PCJIWQNIYYCRYKXP','LCMJ','ZBPYALSCCRKQZPYUBSH','BLNEFR','HQUIXQZPUFROPT','KQAAXRXWTXK','ASFBD','SS','XGRI','JTOZLLOL','BOXPIZAINJQKTONDB','MDCUGIEJFGLVNL','NTWKVIV','P','UFXXBOBSJQH','HU','PBH','OITZFICBDOZEQGJZR','QPJBLCBJRJVEOVG','UIH','ZMZLKGNXZVAEPLGQ','XZTB','GANVRWYT','XZQRMIRQXVXJ','IWBQZBMJUZSNTIQNZ','WIC','YR','JSK','O','IEQTA','PTPEXJWZBAU','RHRG','OGG','WWM','YTRBYGYZVLTVBOABBTV','GYAIWV','IKJCDOX','DHIRHBKS','COUAAKAIGPVOXYKZUNU','FQFXUVC','VMFAKUVYGHFXKN','IDQGXYDWNEESGJJKP','UX','ZWMSMWYW','PMJBXUXTAVJCGLWZVSDB','RZ','K','HASIYHX','ANOVP','CSIGKZDMSMKOGJ','QRJXLP'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'PMJBXUXTAVJCGLWZVSDB'))\r\n%%\r\nnamec={'NFPFLMH','GAFVH','SHEZMDSY','JIJZGWWNDRDMYDR','QQMX','WMMQGRHFEFUTRAPFDTGO','PSDARUKGIRQPPUVFRC','KJTFKQDDFGECQ','EPXNZ','UKVDPBFLOT','EVMBIHENGAPWRMCZY','HYLDZIDPOHTFLM','TJSZJJSIIMZZPCVC','ZTOUSR','XXRCJEDFNWFOEAJMZWO','RDGNFRAQLVJ','ALLFOJKOQZHRH','KVYTQ','LWOGBFHZGSDZIF','OOKNBR','LAYXJREXHYHOFNVDYU','TUDFRHK','QSOJMHSDLKEQ','SHSMUQ','CMTKCFROCQCXUF','KH','XOZDSHULKCAJXTLSY','FIDNCZSFGGBVMTZAHLGB','IQATEQVBYYPS','CRBI','BPLUC','RJOPKRXSFXES','VECJRE','KENJGUMXPFCVFRGYLRXE','GQNDQHKZFWACPPHKH','H','BFIKUAPSNFBICRIEF','FPMMPOLVTYOYZQ','RXEFHBHDQPNZKGONNL','HCYWTBJMGLFTXNWRR','YRMWICLIANCOCDQPA','UTHNCEFVWHBJQ','BRBKTINOYU','QIGQJAMGVZRZWSYIZ','HTQTVZ','DCVL','T','WUXLTOMJAU','ZSGGRZRNIM','AXTNTJGS','RHLXTUPCTDU','JIFFRKNRFWOZEEORFV','DKOFVRRATZFQMHLYFZJ','XFL','FQCZHFFOCS','LTMQKYUNSRBTJQ','FDFAUNSAGUDRZCEPE','KAOLUPTGFQE','VUXIXPPGT','XNIRSGTMABTHD','DDTXHXCXAJTDOCCOMM','BXZ','YPN','KLFWT','MOWEPNYTTSN'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'DKOFVRRATZFQMHLYFZJ'))\r\n%%\r\nnamec={'DGQCQLGJ','IBNJOGJBGPPIJBQLK','GJXJFBIQKZILAJSF','AESPLZNFPV','YGNAI','IHYDPEYHDWSZSHL','MXGAONGONU','UGSZ','OZJGN','YMIQAY','SAQDN','JEYJCFHUTVPVU','GDWDYNKXS','DLAHOBKTAAJVHWDSCAG','EWBYPMZZXPRXASZTS','UBYMVWWU','SMHTGO','TJ','EZXTZDO','VBORBLBYKPOSDTZOR','ZKXZFIOALVYWJCMDNXSU','NBSPRJIEHJSUJP','QQOVT','BJQOKGDVSATEWK','RSMDGSYIUJIMGDK','ZVXTVM','HI','ZNEXBMBUCDHEKAAFRVCK','PXRPCEUHWKPJNKHDREBT','BQOWMIYWPSJXMNNLD','BONKTPSWDOYWKRJQCV','SFCOZDUJOXPDSTGL','UOA','PRAELEJ','YMXZTQXEITWI','ASSGLRORNYRWAIEVZXA','UAAMSIDSAVCP','WZZIPNBPDBMRF','IRJIWIZHIQ','GLNTZIG','YTBPNYRLDZUEZMX','HBDQ','CTENOFTKBHWQCPBDVBEQ','DJTTAVIFEPKQZBR','PZXNIGQLJKYZTF','JFJCZY','LMFUHVPAEIDUU','VW','RKGORHTQ','OMZPHYGOPN','LSPOAHWLQBVPPIW','RBKGXMLIRLGCSVRMC','NXLYDZLCQIMTNPT','DXHLFTUSVQXHWXBJEUGG','GSOLEEMHTARPUU','EVTNRJMPPPNZAZOTROD','ZYHWOMFE','WFNGMJBXWAKJOIEDZC','GGR','Y','HPAUOFVMOZGQEMHWLRPF','DHBEORFBKKFGZYYX','NBSLOZZRYECVU','VCFACXJEHVXXPHHI','KWMFJCEUWBLFDQGCKD','DGNNMDVNODLPYNL','NSCIEILOIGJDGJHB','GH','BSWXELUJ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'ZKXZFIOALVYWJCMDNXSU'))\r\n%%\r\nnamec={'FPMUJIS','HTMLYGHYLNM','AGBTPKMRJ','SSWGUVSDZMBCNLL','DRPGG','XTEZNPFNRTBMOONIMM','QXTCFLIXRRIWDEA','MSMOASUGYSLK','BAFDNNUXVTHRPG','QSCURWGROJRCTOAWTN','MQTOBZ','JOVI','DSBQKFOTVDJIWXQDHRB','FONRHGIY','FMQTCJXWSUXCFJGFT','GQCMFHVN','VWDAHFTQELVINRY','ZSXBRGGBQPAI','FACVSATHNHXZY','KRUJPOGMAOEIGC','HUAUVGUDNZCUBXOVCFA','FOAGVCEUXQFKWZN','MPZDESSR','JPMFMGKKIPA','EIOA','UGOBBKLLTBVNSJ','QTEZESAEJHECT','AQHX','JEVMRDXJI','HTDQHKHXDXWDC','DXMHCHAFKHGZFF','IVCICJXFDPXGJQB','VBBSD','RCCEAHTANIBXXG','JQSIKFVLC','MUPIJKDJRO','I','KJFEHXFBPLU','OOBTEQZHVFQ','HZRKWOHLRJQMJXQQFP','MGBUE','HNTGZWFGJOYRTDPIOYRW','CDBPFXKKTQ','DODMJB','RUUDHNCJJKFHSIJ','FMKIQBPKVVULLXSYS','PWZUVYKBYT','AXAAJXQTHQW','BCFTWBGTJNUVHBLRDANP','M','CXYFOTWLRLUGQC','QIPNMPJJGOQQJKUDHL','SEMFHZMYJKPSRWDIBBOJ','LSTYNTFXHB','FJWJDMSNAUZNKWOK','IYFJHGCQLT','WYAMQDEOIWZBUB','JTTGQNLSOKVGVT','KOJY','BLXNETEFIXMKZ','NZGEYKPUIHNBKPPST'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'BCFTWBGTJNUVHBLRDANP'))\r\n%%\r\nnamec={'OGLCMJBGUVZRYIQ','IAMGPYOLQRXBPWETMFUS','LFEFOVWUSDWNRZHN','JUFJK','VUCXCORYGMQJV','WMJZYKBSPZ','JQIPDYEJGULDLWRQS','NIPIYZGNRUVPHQH','C','MB','PHNNR','REMZRZEHIU','PGRAJVBZXFCGPVZCRWGQ','XDOXLEWSCUCVLRKXKPIA','DZRBFRJLKM','YXJGVDCGEPIUDRMMUJ','XPFKQQMUX','NYETXVLWZ','AHVRMDILF','EUNGVKSGIYWEMDUDOMV','MXAKTAWYASGFR','SOYII','VLOQS','UBGGXIZP','TPLZMVARFYPOY','FQN','NOUT','FHUMXNJNEJW','ZIPLCMQSSK','BQMCBF','NXLGMDKNTAFLJ','ITAQMINQG','SDAXMOC','RMANBAJMHICQTYYCC','SAXDYOXOPFOVHATLAT','IICKXBVXZTSLZRJX','PBHAWOQKGFHGG','IICOLCA','LJWNYXM','HBHVKJU','QNWWNNTS','VSXYT','FALWHF','UP','CWRGCUHRZFMK','FFMM','REIBDNXXQUDRSFF','N','KIMMFRQROZNWQ','MJZHXG','LSEDGGWOS','LUUMQ','FTXJ','SK','ORFNYJYWPQVKQDBL','YIYJJPAZOPEUZGA','HFZSILOBJRFZVEFXGQIV','U','PD','QLCOG'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'IAMGPYOLQRXBPWETMFUS'))\r\n%%\r\nnamec={'DAB','EIXCAFT','TOCEGNSLVURCYGXYH','VHWLWNNWLSLJ','SLDYYVHDOBBJHQZGKQ','CTPCUS','XTLDBORFZZICB','KY','HAOTVBCDRVP','W','SK','GAPVLDXBFIUTFBKEDMUE','KSGVU','TJOTZA','MXSRCIGHK','DFNCZJJHSKYHUAPUSFCM','UOYNI','LC','ULQKSEVEMLFASZTPX','RGMWDMYOOMFPGZLBITDK','WDGKCC','GRLSDSDHX','AXAWWINMLYJE','HGACOLRR','FMVUD','NWEEXSBYIFSJ','PJ','HDFGOWPULKAPXWLHAYBQ','GELTA','RORCEHVHKVWDFE','FJGMDMQVDSBISR','FTNKXXUSVYDSMMY','ICBWKYWUKPZVFAY','PJYAKSXMEJUCEL','VKMJ','M','TGF','WBIYWSRXTQZXUVLL','VPMMEJQOZLS','FLKPDEIUTD','BONRSRVZURJJF','UXAKLFHECVSZ','XMPLMGIW','SJIMJEJMH','ROXFKZUMYOZCRNGPVX','RCSAEOBQWZGVBJIUUGFH','OUPWMFPVX','B','GQQOIG','OTCXWPJVMJ','VGTDMRFGKUESEULXWMHD','QOTNGYBIUKFTVR','JPEGLYJIAPXNFJ','ZOVITVARNFD','UHU','BVTJ','TR','YWNOR','CIWVZWRFWI','EP','TIPARSTWGTMGQ','HFBNIKWGVTVPIVXJ','LUSQXXOCI','HMAMMWEENPRV','IOZJZHGVSOHLBLM','KYBWVGCSLSFCEGQVHEU','ZITYLR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'RCSAEOBQWZGVBJIUUGFH'))\r\n%%\r\nnamec={'TTXYV','FH','ZTCNWGXIBALWVRJEBQ','OKSHHRPY','JHVFGPYOQQEISOFLSZZG','PRWOSAGQGVKMT','DYYOWEDKYQCWBLOIA','OIMSYDORNPBGUQL','YFMRJZBDJJQ','TCYTFJIVMUYIFDDREWE','SGOEEGPEAXBGFIEA','BUAXXDKUSG','GMCKRI','FEQUFEDFWDOQXOJIJ','RQ','AKFR','OZFSDRQHFTEOSGYPEUX','GFQCOQIJNTMAFM','QQZWXV','IMJECDKAAPIYAQ','BWOV','STGTPACIOIFRLPJDWSOE','QE','WREKGB','NUOFONFNKHRRRUCFSQJ','YF','QXWSXRE','BBTGHKTJRGEVBHDL','ICBWV','HATF','VQUSOZSKOJEN','HQDPQFJASYSNELVKQRIX','WAHHOCW','XWK','VUXSCTJM','SDMLYIZOIXNHHVHPFJC','ZGBHPGEBZIFLQASQPBX','JOICR','VQLTK','IHXBYBGJQ','GRCVQSIN','CWNP','YEYXZ','UYQXYILKM','TXTCVYYBKMG','GZQQXYHISQAVSEV','KRMJLFIKDEIDQOTKWT','ALMSQZFFO','JYWX','YDZZLBSWPMPLQEMWYJGR','WGKOCBFSNEOO','AOSH','EDOIZI','YSVQYXXXZQLBEYDBMJX','ANXECVMPP','YJRZWZPPEYQIDB','WBBQUKT','WDZUFNAYE','FJSV','VWOOQHWNCYQYVTLDYQ','QOHSNMTXHGKNMU','CSSWB','ZFCMITSSCASZRYHAG','MDTXBI','QJLOWPODZEVYVEQKVKRN','ERLYKNCWD','CKDKQGMVLT'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'HQDPQFJASYSNELVKQRIX'))\r\n%%\r\nnamec={'PGOBRMNZXGEFGZTNN','SWP','HDHNVNTTTJXCERAAFGBR','OBW','QVFMSDDRXWIEDRGNH','OMEFFWRLXJRCWOOMD','HMZUDITBNSTBEYSLKLMT','ETIH','PTYHBXCBFZPXYEQUVPIY','MHGZDKPEJGTUAWPU','MPIG','F','WBUQNTXAPDHLN','AZFTRNBLZRLBTQ','LEPERCJ','RKFUJQZPJ','UUAZVLVIPOXA','IFHCPTRDBTTL','CYKCTCGKKNZ','G','BRZTFXAWYLHNWHIABC','AFMRFLHODYSQOMNRMDQU','SKRDD','UAD','KYRFULXATNJNWVIJDM','GDGJGHXJDG','PRZPQUIVNVAO','EDAHBBOWBNPCCLF','FMWRIKZAPI','V','EYRERTKJUXZWZTED','XZUCEWUHUXWO','CA','DMVJTHFWA','K','XGFNCELUZMBAB','AENTWO','TXKDLZBIADFDPAAXAUT','MSSZHKJQJUBAW','EREJWJNHJNZGROCRQ','TRJVHKVWGRBZ','LRX','YZVUFAEVGFYQJPP','HSIJNWMBQG','LIBDAVVDMYUDOXTNLO','URGYFJWFKRGHITC','CQWWGPZMSXSMFHADB','MPCOYINCUHUOZHGRFF','BJU','ZVRQOFIEAJRYYPNTO','HT','BMROUHB','DSXYRCVVLIHK','OPGUN','FGOXUAVIZBTZH','U','BBAEQHLWAG','GVQD','DIXX','KBHAWAYNXABNCKTIGR','WMENHMGBKR','JJIKDNDXFDZSWDF','STYWCCEBZGK','QT','PYVAYZSIOR','DWCVLFFVKGQQQ','CIUFCLFC','XUGSDVUQYJWVWCIKGF','FZBIHCWWCVVUQEDD','EZLTJFIDEEI','IVK','LYUYPCLLFGBKBFHMGE','OALIWBIFUTWBFE','NHYESO','XNBSFGRFRR','SSYIHIBENSRMRMQFWXZP','OQBUFRJ','DRWM'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'KYRFULXATNJNWVIJDM'))\r\n%%\r\nnamec={'SKHQPUKYYWHWEZCMJIH','ZJKCBUJTATQISUF','EML','QUUAUOHQJAHWBWMOBJO','VTYXGJVJTD','TUSLTKNHZZNSHSQBGJ','MKRBXOLNKUYWIFLLKSBQ','UXERKIPJZQYCTHM','XE','V','NBRLSYAMVBVQRYWLGW','HPTJGSOAFZPOPPTG','CCYHALBWOOWKIX','DKUSRZDIA','KYBCZ','LYBKX','UYVSJMVTYBVRLV','ATIZAYSLSLXEYM','ZCWTXOHTXEQECA','DTJULIOOLISFMBEZSSKC','ARWIOYIXTTZBXVJHM','HKTAOTRC','ZGRGUEHGXSBZLOTLBSLI','RTFLSDAGXHPWTDFRWVK','K','LBOG','BR','NGMNMUUKJLFOUCLEINSM','LKX','CDGQIEQBG','GMKAKVFL','PXJLLT','BNMUVYMZDNXATKMAYJLV','WUIDC','PWQFFOWR','ZA','RLOUPPO','SSPTB','ODCL','QQVEIAFZWVMEYLFIGXQ','QRXXUSBEQRSUZKRMDBY','TKTQTRZUZMFSZXHUXNAG','K','MNYMPJPDXXISND','KO','EVOYOQUTGBCWOAJVD','PIDBDEMRWIA','YHZKOGZHISHPSIGVA','KAZDDVPNOXFM','MITKWAPLDKRXVSAQCIIX','UDJWLVKJ','YMKUDMYGPQSBSS','SMUJ','HDUCMDBH','SKQREOFLWQNLEV','SAPJIHMUJQQCPPFZNNW','KEMJPXGBRHJSHQXTRJFL','VIMJWRXDTPQWJCGLR','CQGLORUCKTVNILVYBF','VTYJGNIWFMPCZLXV','GPRJKLPCLZVULUZX','XIKTOZCVCVHLAJW','GQCARMRCQKBLPMWA','ZVBQUFITYGGNAAVKUAMG','BIN','MGRLXAFBVKJMZSIKZI','VBKDJUBHNWAS','NUZZTUGJVQVKYM'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'CQGLORUCKTVNILVYBF'))\r\n%%\r\nnamec={'KRMMAQO','ZYQ','Y','JVBKJWEEIV','WPA','ZFGRNMWIHAABJ','OADLKMZGAV','NZVZWQW','DFCROJROCQJTMXHEPCP','UKWDMXAPLOQ','VLRMNKYEZXAKNDJDVAS','ZANHQCQOPBOBHQZLLKLO','OXNKHNJUBURGYP','ZVCANF','XJ','IXLVZSEP','FGICSRYYLBLOHXOUS','IFNXIETSAEZCZWME','GQJJHYQAISZYIXYEE','AARZ','JHVSGPGNYHWWCSSN','PJ','MJENAEESKEIZCVTJF','AIOCDJJMFNVBMSO','OLXYHBLJXXLTLDJZ','EEHQKUDZ','KAXVPRUJVY','KOZVNWI','MYEOHESCNYHLJQBSAM','DAQKJKIOCCJGJDLK','H','DRZACTYP','PQBXFPZHGFPA','OTQFQTOFPO','FZXMQIRBZZXYBBQKHOVY','IFFUCESAOGVY','RLMEMFHF','VRNEJHIFTMDKGD','JCFEDDHIIZ','RIXQXPNUFZQHXTCKVI','MDJLLSJCNTOVIWG','FUXFUQ','JLATDEWMQZAZTOQIU','IMGYRDGKASTQAETTHYDM','UMJSFJIFSUL','AGCCG','VW','VACYFIZMP','BVGBQOHMGNOILADIV','IY','CVRUJAFF','LQWTWBEIHHFHCN','Y','OD'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'RIXQXPNUFZQHXTCKVI'))\r\n%%\r\nnamec={'BNQDWNHIZMZIYPJDXE','ZOUOKBHYDE','DZDXCESGTXGU','CNPVALPBNO','J','KHAFDXAHDGWVEECG','RSJBZKGBLGKIQKIONXO','M','LEWPVZQLG','MBFTDI','FIDPIR','BXKUGBCNI','EEIPKZTDXIXZE','VTK','KECUYATRYYZQRFBMQFF','ZMXDTZEVLPUWCOQWGT','DNOUKLHFKLFZPQNLHEJS','LOFTEQNLJQS','TATOHFSMCTXOSEP','ZMLLDLCIOLZDZO','HUYESE','MPCDGQSVDWDOSGQUTNPH','COKSSOTC','VUYTMLCGIH','RDQGJCNGTIHAVTA','LM','ALUDNJ','NQFALWUQETMQ','LQDFSQIB','BMFR','WWDXEZOQLKFQZMV','KJIKCYLOAXOQB','CTHLWRQAOLUS','MNBHMFGMUMCGLFP','IYZWIMPQRLSBWTJRM','RKYPSYJFIJEULGHORP','JGPRZUE','HNBCVUSAZC','IWYOIEQQXRWI','JDFZFLCIJYSRFKEMJ','QRJ','USNVNLTIIWAQFJKB','VLEBPQDTDUSERAWWOZ','ERZEDX','FQEJEZ','YUFEZXEJHKHDFH','XDZIAXZFTOGJL','CFGIJBXFCAQCDV','C','PXQUQLZRXQYDWYEPR','KJKMFXELPRBAE','ST'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'VLEBPQDTDUSERAWWOZ'))\r\n%%\r\nnamec={'WVNPIGSHWNWEYZXVGD','UMGSKUBDCBPB','UMNZDCMZFVJDMV','W','U','KOOAIPPBAGWE','SIFAGBRDPHSJ','IVWKHKFOSGHQ','LTJLYBSSSVDPUWDVZDNR','KQYI','EOAUFDJGPDHZNI','DAUZBZFOGVAOOEUGQ','KZYRVCMEUUNPLNNYJOT','UZNBE','OCCMVSMMDJ','YWJFF','GLM','GC','AGDOIINNERJIZCS','YTVWSC','AHPAFSGFKOKXDPKE','RRIDQBXZCWCYUX','WFHCU','F','UOQWACOSPL','JDRWAT','OSVWNDCLALXOKVENJ','UUKW','SHUY','JHWDU','DXTKXVJOOQVEGBWVG','DFPIHXSJRV','XRUYYIIKNQXBA','IAKFHSMWGEKHVYK','R','DMNLUXLZCE','CKYUCCAHYLGCVIPISM','VZTC','V','JPBGCNJEGIUFTRDNIEJ','INTAI','YVPIHIHBV','FTYRQFMSQJGCRUVJA','TVDUULV','FSOVW','ZEGWUPW','LOEBGW','TZDKAXPMSKNGSM','AKPXNTPEQX','UPMFMQWSJPKAHNPUEXB','JAKUMRCRKNVXLFMOBC','IPWVL','KEUGMAZSUM','ASBULEZPSS','ZTDRKHGMDKJADZVRAAJ','XVQGIFQDY','MTS','WGLYHONYFBQCVYRLKQT','CPXOTZIU','OBENPRAUK','RFNAWDB','X','DACJTOFEPEFTJUJCBSLG','MFHHGIWHDWCMMQ'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'KZYRVCMEUUNPLNNYJOT'))\r\n%%\r\nnamec={'EPLXOSPBMNFLSVDG','DTILFFBMPHCWF','LUK','NOBSCFX','EPDPPGUNHYLPCFULNBX','UGVQYO','LZKFJXFD','MYLRRLUCBSYOESDSV','VSZ','TKPWUXBUS','C','DUG','YQNEOEZGP','ZVJZLKE','WO','YOZHALURQOQMUB','HXROEIQAIOX','DMI','LIBXFTJTFNCXJSRSYNL','STUDO','PWNS','HLVJXEDNUFBHXM','HBSREYCMRIAKP','ADRBV','BDKDKZXILBIUFDXJ','XCOIGOLXHGMAC','DMKYS','BTB','QGSIUWSKDFJB','CDYFIEAOOZHMEDKWDCE','XOPEJV','KBHOZF','ALGLCCLGGGIUKCQ','WNABLFRW','BOHFVKPNFNU','ZWIDLE','QMXHBR','AKAPNCG','PLZFRUTRXBV','JRGWCGXXX','XDCPLHRRUCVPAAGLRVEA','OJQGLWVHXMD','OQOXGIGW','GMPTQHVAQAU','MQWFZORJAXYHCBV','HLG','WXWOXBOONMBUHHHI','BDGZTDIKBTZHENSJDO','QHUXOUYONUI','KSKPVDEQKJMXTN','ENFDUSQOYV','OVSQKUAAGDBKVX','RMUYDACJYXNBOXJR','GNE'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MQWFZORJAXYHCBV'))\r\n%%\r\nnamec={'MNXBEGBOOMKSS','AAZTPDMQEO','TUHWOCETRPPADJKVLKNG','JEHFKQYAQRG','N','TLCFCBFDHORCMRBV','ASYIFQQOXKIANN','GKABRTPVTGOKT','VFXWJ','HJGWWTQVVQW','FAETTKDWWSNDBLELSCC','AQMLDDCLSCJSHBXXLEV','FCLINFL','GP','WTUEHONR','DYPQIAUVGQJEPH','NRATMPUOKXBRU','MHJSZZUW','FSKSG','A','PPYEIGVJYDSMHVS','RIFD','WPHURHYCPKGNTNUW','LCRCTZIPWHHERMNTTYSC','XURWMZEPVSJJSYXP','BLUSPZELJQCTEQ','WLAJ','SKUEFNQJICEI','QRFYMQU','JFCHFLSXNANRFGEEHMG','MFTWKGYFBSEG','WVMOEVUWTQ','UDADALRK','NOHSWOJPOYLQRFFKBF','BRWEECKSUSNYIUVO','PLXCUMWAXCKL','HAARTVR','VRQNBTF','WRR','NJO','QJKWILPW','PJYHTCUMVKREZVJKW','JVKLYYTJHTHXUX','JZMWROBNJKB','ECCGFSWZPYCXRQRJSMV','D','HYAKZTGTNEZBU','MOGYEXDWFRYPBOOCYJN','USEPLXLFEHD','LBYKMNZCO','Q','EZNQBXXMQ','XO','WRXOQWATENOHYXVL','KT','DMRM','LUDNFTONTDKYJROC','RNXTYWHQYTWPO','MGRSTVXBIHLLGQFRLZB','L','EWULHSYNE','QMTQMIXGOUXRQYT','XMF','LPVQNZCCNSHCFTCY','IAZXRLSGWCWHX','PFSBLIFZTIU','QMSCWVUOWMCWJC','LRFRUSZNRDZLMIOWVM','KZCEBBILHZAFHSCYNG','YKTQYLUYWTRZPLPWZCOX','DTMTYSITUU','OXJOKUBFMYNLQLEZGP','ZKRZVHHK','BGBK','MBVJDMWHZDY','TXSVLOEKVOYO','ZZCSPJRDEVLMN','PVDJCJFNXTHXQCRQUC','VYDDKBOOKJLEWEPN','IRPTLCKJYXZSZLB','LSFPOTLVCP','BO','JZTLFYQRTPVRYOWBULN','FCEKHALVASPR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'TUHWOCETRPPADJKVLKNG'))\r\n%%\r\nnamec={'FLUEJJOMBLRDXEKQCCRU','LIYYDJ','OGTSXHBKSCDOEMQGVDC','SGWHEQZX','WUBXLLDNHSJT','PKDSEKIWIAMFRNY','GIW','XELJSPLL','BPHRHTSHY','DUXFYRXHOZRILQBS','WJHWDWVGEGLBABTS','SYLQBFT','HDFKJSBPPTQAUKGPEKE','LBJVIZZFNWB','BLQJPEPKXZIIWS','MWN','NEAINWUGPYOQM','G','HQCZZDRFPV','VNDZGDRZRBIXIYIZGA','PHKKYNLYUDODIR','GUICHJCXRXEYPCWAMJTZ','NHPLQGCWTKQ','TSDGDBDXDSXHMYJRBZH','LNGZYQMNWQSFVWI','RQPLKZDUFIXLOKF','WKUHTIYVUYNPHZ','UFZUFBPGKWRTUL','CAB','IJ','ZZQQALONCTOJUOOJE','DPDASWBKPMHTUBAEVK','SAKYBOLEFTAHWCZMU','UTTKNLHEVDO','NIWTMTZBTXIL','FJK','BAGMDT','KYPNASBVHNKYGJG','XEHDPYEHBRKUD','GSDRVABVNDP','ZZRKWNVKGW','RFWHDCDCMQCNHHQPSLCG','MU','STTUZEBEBPERPXEPBVW','YYRZHPQOBS','OOUYNTPVFUGGDZO','PMMAVJTPULZORKLP','GNJETMYHJ','MQNQRERGPCTSUZGAWRH','GG','PCSTZVH','H','GZPOECJ','IBWSJPQHVC','JNGEERMGZUNUFJJTJAUX','VIEVIXMGL','KURQLWQTHSKSKBUOU','NDXNTI','WBPHX','QEME','XXRQF','ARCFUSSRHARNWQKXXJ','ZMKVSZGFLLFEHJTRU','ZMHIEPKIU','GHRIVF','DHBID','HFKRRAMHMDWXWWFUMGZD','XGYYOU','OZSBMKFLSRGCCRHR'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'GUICHJCXRXEYPCWAMJTZ'))\r\n%%\r\nnamec={'KMQK','NOAQIPAOFRHAMMR','YVCDENPUPB','VYENYLJYROVQEIPEM','NCGEJIBYURR','ALNNGYOAM','N','YNSSDMYHIDH','TUTLKDZIBAC','OWITMHACTQCUTJW','VLUOBXBJNDB','RPARMIEFDQVGDGDB','KPRDR','JMUYVFQAY','BE','JBNMLITMCTMZAEKU','X','YMUZDIVKR','XWNEAZIYQGLHH','TUWLIMXZHB','SKALCOICJQTZGZZYQ','KAFVJJOERHNSNIMTI','UZIXNKITGATLNNUYAH','UYGP','XPIGOTGDHMDQJQ','DVCKEHHQCF','JUGYEISLDRPGBI','AHR','ZUBVTBHVUWTS','SPQMHDL','FTGF','PTFFMZFEIERBXJDMSBA','I','DOJOUGCRHDAUBUB','N','HPTUDMUZNYZMJCGGL','BLCVBZECFRLMCACF','WSBMPQ','VOWCMYG','HHBLB','MKXFNVK','F','VKFSSVBDFEPCVJWKKBX','Z','FIAZFRPZE','VFROTTGAJ','X','ZNPZNKADTQ','J','UAL','RRXOTDRSERENERUXX','S','IBN','VFBROKKMYVA','JTXXXCTWZMOGQWHWMFQM','SQBKRULGFVWXHHTL','ZTOCLWJYANBT','DVIPYGNXJIVQ','CTGTIU','UJFVZGZRVISC','MRONZFKHKJSVJIW','RMZGHFTHXSJJATX','OERO','PDRQDKX','TFMRFR','MKZOUDFBJEGXMWBHCR','MC'};\r\nLeader_str=leader(namec);\r\nassert(strcmp(Leader_str,'MKZOUDFBJEGXMWBHCR'))","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":19,"test_suite_updated_at":"2017-02-26T21:57:50.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-02-26T21:47:39.000Z","updated_at":"2026-01-30T12:45:57.000Z","published_at":"2017-02-26T21:53:21.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\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://code.google.com/codejam/contest/6304486/dashboard#s=p0\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam 2017 Kickstart Leader\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. This is the first 61 small cases with no spaces in names.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGoogle Code Jam 2017 Qualifier\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is March 7, 2017. Typically four challenges with small and large aspects with 27 hours to complete.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe GJam story is to determine the rightful leader. The leader is the person whose name utilizes the most unique letters, spaces do not count, and if two or more people are tied then the leader is the one whom comes first alphabetically, with space preceding A, given a list of 100 or fewer names.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [names], a cell array of names using only A thru Z; max 100 names\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [Leader], a string of the name of the leader\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [names] [Leader]; {'ADAM' 'BOB' JOHNSON'} ['JOHNSON']\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor the example the first two have three and two unique letters while JOHNSON has five unique letters 'JOHNS'.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eTheory:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Brute force processing appears to be the way. Methodical processing and function usage can minimize code size.\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://code.google.com/codejam/contest/6304486/scoreboard#vf=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam Kickstart solutions(C++,Python)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\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\"}]}"},{"id":44843,"title":"Nth Order Polynomial Regression","description":"Inputs: \r\n\r\n  -two vectors x and y (row or column) \r\n\r\n  -order of polynomial, p\r\n\r\nOutputs: \r\n\r\n  -vector of coefficients [b0 b1 b2 ... bn]\r\n\r\n  -R-squared value\r\n\r\n  -vector of residuals, e\r\n","description_html":"\u003cp\u003eInputs:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e-two vectors x and y (row or column) \r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e-order of polynomial, p\r\n\u003c/pre\u003e\u003cp\u003eOutputs:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e-vector of coefficients [b0 b1 b2 ... bn]\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e-R-squared value\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003e-vector of residuals, e\r\n\u003c/pre\u003e","function_template":"function [b,r2,e] = RegressionN(x,y,p)\r\n  b = x;\r\n  e = x;\r\n  r2 = x;\r\nend","test_suite":"%%\r\nx = 0:5;\r\ny = 2*x;\r\np = 1;\r\nb_correct = [0;2];\r\nr2_correct = 1;\r\ne_correct = [0,0,0,0,0,0]';\r\n[b,r2,e] = RegressionN(x,y,p)\r\nassert(nnz(abs(b-b_correct)\u003c1e-12)==p+1)\r\nassert(abs(r2-r2_correct)\u003c1e-12)\r\nassert(nnz(abs(e-e_correct)\u003c1e-12)==length(x))\r\n\r\n%%\r\nx = linspace(2,5,12);\r\ny = exp(x)';\r\np = 3;\r\nb_correct = [-110.9230,126.8980,-46.7825,6.3467]';\r\nr2_correct = 0.9997;\r\ne_correct = [0.8726,-0.6361,-0.8963,-0.4527,0.2214,0.7465,0.8663,0.4864,-0.2751,-1.0207,-0.9863,1.0742]';\r\n[b,r2,e] = RegressionN(x,y,p)\r\nassert(nnz(abs(b-b_correct)\u003c1e-4)==p+1)\r\nassert(abs(r2-r2_correct)\u003c1e-4)\r\nassert(nnz(abs(e-e_correct)\u003c1e-4)==length(x))\r\n\r\n%%\r\nx = linspace(5,7,8);\r\ny = [-0.9238   -1.5011   -0.2963   -0.2268   -0.9897   -0.0372    0.1509    1.5324];\r\np = 3;\r\nb_correct = [-196.1472 101.5622 -17.6070 1.0186]';\r\nr2_correct = 0.8063;\r\ne_correct = [0.2569 -0.6944 0.3739 0.4017 -0.4505 0.2224 -0.2019 0.0919]';\r\n[b,r2,e] = RegressionN(x,y,p)\r\nassert(nnz(abs(b-b_correct)\u003c1e-4)==p+1)\r\nassert(abs(r2-r2_correct)\u003c1e-4)\r\nassert(nnz(abs(e-e_correct)\u003c1e-4)==length(x))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":183622,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":12,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-01-30T14:42:51.000Z","updated_at":"2026-03-11T08:42:08.000Z","published_at":"2019-01-30T17:17:50.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eInputs:\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[-two vectors x and y (row or column) \\n\\n-order of polynomial, p]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eOutputs:\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[-vector of coefficients [b0 b1 b2 ... bn]\\n\\n-R-squared value\\n\\n-vector of residuals, e]]\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\"}]}"},{"id":60242,"title":"CamelCase to snake_case convention","description":"The CamelCase naming convention capitalizes the first letter of each word. In snake_case convention, words are written in lowercase and separated by underscores. \r\nComplete the function to convert a function name from CamelCase ('MyFunctionName') to the snake_case format ('my_function_name').","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; 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: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 93.0256px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 386.491px 46.5057px; transform-origin: 386.499px 46.5128px; vertical-align: baseline; \"\u003e\u003cdiv style=\"block-size: 42.017px; 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; perspective-origin: 363.494px 21.0085px; text-align: left; transform-origin: 363.501px 21.0085px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eThe CamelCase naming convention capitalizes the first letter of each word. In snake_case convention, words are written in lowercase and separated by underscores. \u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 42.017px; 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; perspective-origin: 363.494px 21.0085px; text-align: left; transform-origin: 363.501px 21.0085px; white-space-collapse: preserve; 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; perspective-origin: 0px 0px; transform-origin: 0px 0px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eComplete the function to convert a function name from CamelCase ('MyFunctionName') to the snake_case format ('my_function_name').\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function s = from_camel_case(name)\r\n\r\nend","test_suite":"%% Test Case 1\r\nname = 'CamelCaseExample';\r\nexpected = 'camel_case_example';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 2\r\nname = 'AnotherExample';\r\nexpected = 'another_example';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 3\r\nname = 'TestCase';\r\nexpected = 'test_case';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 4\r\nname = 'LongerCamelCaseExample';\r\nexpected = 'longer_camel_case_example';\r\nobtained = from_camel_case(name);\r\nassert(strcmp(expected, obtained))\r\n\r\n%% Test Case 5 (Random)\r\nRandom1 = char(randi([65, 90])); \r\nRandom1 = [Random1, char(randi([97, 122], 1, randi([4, 9])))];\r\nRandom2 = char(randi([65, 90])); \r\nRandom2 = [Random2, char(randi([97, 122], 1, randi([3, 9])))]; \r\nRandom3 = char(randi([65, 90])); % Random uppercase letter\r\nRandom3 = [Random3, char(randi([97, 122], 1, randi([5, 9])))]; \r\nname = [Random1, Random2, Random3]\r\nexpected = lower([Random1, '_', Random2, '_', Random3]);\r\nobtained = from_camel_case(name)\r\nassert(strcmp(expected, obtained));\r\n\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":208445,"edited_by":208445,"edited_at":"2024-05-08T16:38:51.000Z","deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2024-05-08T16:38:52.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2024-05-08T16:23:42.000Z","updated_at":"2026-04-20T03:05:27.000Z","published_at":"2024-05-08T16:38:52.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\u003eThe CamelCase naming convention capitalizes the first letter of each word. In snake_case convention, words are written in lowercase and separated by underscores. \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\u003eComplete the function to convert a function name from CamelCase ('MyFunctionName') to the snake_case format ('my_function_name').\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\"}]}"},{"id":263,"title":"Nonuniform quantizer as a piecewise constant function","description":"Implement a nonuniform quantizer as the following piecewise function:\r\n\r\ny = -3.5, x \u003c -3\r\n\r\ny = -1.5, -3 \u0026#8804; x \u003c -1\r\n\r\ny = -0.5, -1 \u0026#8804; x \u003c 0\r\n\r\ny = 0.5, 0 \u0026#8804; x \u003c 1\r\n\r\ny = 1.5, 1 \u0026#8804; x \u003c 3\r\n\r\ny = 3.5, 3 \u0026#8804; x\r\n\r\nYour function should act elementwise on array inputs.\r\n\r\nFor example:\r\n\r\n   nonuniformQuantizer([-4.0 0.0 2.0])\r\n\r\nreturns\r\n\r\n   [-3.5 0.5 1.5]","description_html":"\u003cp\u003eImplement a nonuniform quantizer as the following piecewise function:\u003c/p\u003e\u003cp\u003ey = -3.5, x \u0026lt; -3\u003c/p\u003e\u003cp\u003ey = -1.5, -3 \u0026#8804; x \u0026lt; -1\u003c/p\u003e\u003cp\u003ey = -0.5, -1 \u0026#8804; x \u0026lt; 0\u003c/p\u003e\u003cp\u003ey = 0.5, 0 \u0026#8804; x \u0026lt; 1\u003c/p\u003e\u003cp\u003ey = 1.5, 1 \u0026#8804; x \u0026lt; 3\u003c/p\u003e\u003cp\u003ey = 3.5, 3 \u0026#8804; x\u003c/p\u003e\u003cp\u003eYour function should act elementwise on array inputs.\u003c/p\u003e\u003cp\u003eFor example:\u003c/p\u003e\u003cpre\u003e   nonuniformQuantizer([-4.0 0.0 2.0])\u003c/pre\u003e\u003cp\u003ereturns\u003c/p\u003e\u003cpre\u003e   [-3.5 0.5 1.5]\u003c/pre\u003e","function_template":"function y = nonuniformQuantizer(x)\r\n  y = 1.3;\r\nend","test_suite":"%%\r\nassert(isequal(nonuniformQuantizer(-23), -3.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(0), 0.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(1.1), 1.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(2.9), 1.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(-Inf), -3.5));\r\n\r\n%%\r\nassert(isequal(nonuniformQuantizer(Inf), 3.5));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(y, nonuniformQuantizer(x)));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(y', nonuniformQuantizer(x')));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(reshape(y,3,6), ...\r\n    nonuniformQuantizer(reshape(x,3,6))));\r\n\r\n%%\r\nx = -4.0:0.5:4.5;\r\ny = [-3.5 -3.5 -1.5 -1.5 -1.5 ...\r\n    -1.5 -0.5 -0.5 0.5 0.5 1.5 ...\r\n    1.5 1.5 1.5 3.5 3.5 3.5 3.5];\r\nassert(isequal(reshape(y,1,6,3), ...\r\n    nonuniformQuantizer(reshape(x,1,6,3))));","published":true,"deleted":false,"likes_count":0,"comments_count":2,"created_by":4303371,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":58,"test_suite_updated_at":"2012-02-05T15:02:53.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-05T15:02:53.000Z","updated_at":"2026-04-20T14:17:41.000Z","published_at":"2012-02-05T15:07:06.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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eImplement a nonuniform quantizer as the following piecewise function:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = -3.5, x \u0026lt; -3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = -1.5, -3 ≤ x \u0026lt; -1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = -0.5, -1 ≤ x \u0026lt; 0\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = 0.5, 0 ≤ x \u0026lt; 1\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = 1.5, 1 ≤ x \u0026lt; 3\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ey = 3.5, 3 ≤ x\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour function should act elementwise on array inputs.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eFor example:\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[   nonuniformQuantizer([-4.0 0.0 2.0])]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ereturns\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[   [-3.5 0.5 1.5]]]\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\"}]}"}],"term":"difficulty_rating_bin:medium","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"difficulty_rating_bin:medium","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"difficulty_rating_bin":[["difficulty_rating_bin:medium","","","medium",""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f515e4180c8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f515e418028\u003e":["medium"]},"filters":{"#\u003cMathWorks::Search::Field:0x00007f515e417628\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f515e418348\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f515e4182a8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f515e418208\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f515e418168\u003e":"difficulty_rating_bin:medium"},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f515e418168\u003e":"difficulty_rating_bin:medium"},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007f515e418028\u003e":["medium"]}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"difficulty_rating_bin:medium","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"difficulty_rating_bin":[["difficulty_rating_bin:medium","","","medium",""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f515e4180c8\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f515e418028\u003e":["medium"]},"filters":{"#\u003cMathWorks::Search::Field:0x00007f515e417628\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f515e418348\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f515e4182a8\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f515e418208\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f515e418168\u003e":"difficulty_rating_bin:medium"},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f515e418168\u003e":"difficulty_rating_bin:medium"},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007f515e418028\u003e":["medium"]}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":45218,"difficulty_rating":"easy-medium"},{"id":50574,"difficulty_rating":"easy-medium"},{"id":51297,"difficulty_rating":"easy-medium"},{"id":2629,"difficulty_rating":"easy-medium"},{"id":2007,"difficulty_rating":"easy-medium"},{"id":2479,"difficulty_rating":"easy-medium"},{"id":48690,"difficulty_rating":"easy-medium"},{"id":44862,"difficulty_rating":"easy-medium"},{"id":45337,"difficulty_rating":"easy-medium"},{"id":42823,"difficulty_rating":"easy-medium"},{"id":46848,"difficulty_rating":"easy-medium"},{"id":44246,"difficulty_rating":"easy-medium"},{"id":44472,"difficulty_rating":"easy-medium"},{"id":3010,"difficulty_rating":"easy-medium"},{"id":61036,"difficulty_rating":"easy-medium"},{"id":61188,"difficulty_rating":"easy-medium"},{"id":47310,"difficulty_rating":"easy-medium"},{"id":50892,"difficulty_rating":"easy-medium"},{"id":1443,"difficulty_rating":"easy-medium"},{"id":1737,"difficulty_rating":"easy-medium"},{"id":2793,"difficulty_rating":"easy-medium"},{"id":44882,"difficulty_rating":"easy-medium"},{"id":57884,"difficulty_rating":"easy-medium"},{"id":54285,"difficulty_rating":"easy-medium"},{"id":44421,"difficulty_rating":"easy-medium"},{"id":58728,"difficulty_rating":"easy-medium"},{"id":50292,"difficulty_rating":"easy-medium"},{"id":45882,"difficulty_rating":"easy-medium"},{"id":42484,"difficulty_rating":"easy-medium"},{"id":42793,"difficulty_rating":"easy-medium"},{"id":1786,"difficulty_rating":"easy-medium"},{"id":125,"difficulty_rating":"easy-medium"},{"id":49082,"difficulty_rating":"easy-medium"},{"id":120,"difficulty_rating":"easy-medium"},{"id":47558,"difficulty_rating":"easy-medium"},{"id":2012,"difficulty_rating":"easy-medium"},{"id":42438,"difficulty_rating":"easy-medium"},{"id":640,"difficulty_rating":"easy-medium"},{"id":42917,"difficulty_rating":"easy-medium"},{"id":45177,"difficulty_rating":"easy-medium"},{"id":43564,"difficulty_rating":"easy-medium"},{"id":2362,"difficulty_rating":"easy-medium"},{"id":2051,"difficulty_rating":"easy-medium"},{"id":2120,"difficulty_rating":"easy-medium"},{"id":1985,"difficulty_rating":"easy-medium"},{"id":45446,"difficulty_rating":"easy-medium"},{"id":44078,"difficulty_rating":"easy-medium"},{"id":44843,"difficulty_rating":"easy-medium"},{"id":60242,"difficulty_rating":"easy-medium"},{"id":263,"difficulty_rating":"easy-medium"}]}}