{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.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-04-06T00: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":54770,"title":"Count the peaceful queens","description":"In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such that none of the black queens can attack the white one (or vice versa). \r\nWrite a function that returns the number of queens that cannot attack a queen of the other color placed anywhere on the perimeter of an x chessboard.  \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: 328.7px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 164.35px; transform-origin: 407px 164.35px; 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: 85.1833px 8px; transform-origin: 85.1833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn a 5x5 chessboard with a \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Queen_(chess)#Placement_and_movement\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003equeen\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 272.283px 8px; transform-origin: 272.283px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of one color (white, say) on the perimeter, one can place 12 black queens on the board such that none of the black queens can attack the white one (or vice versa). \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; 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: 372.883px 8px; transform-origin: 372.883px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that returns the number of queens that cannot attack a queen of the other color placed anywhere on the perimeter of an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, 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: 3.5px 8px; transform-origin: 3.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ex\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, 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: 42.0083px 8px; transform-origin: 42.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e chessboard. \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\u003c/div\u003e\u003cdiv style=\"block-size: 226.7px; 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 113.35px; text-align: left; transform-origin: 384px 113.35px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline;width: 764px;height: 221px\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/oAAAEmCAYAAADShevcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQ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5kjAAAAoBpyLfQBAAAAAEDf4mZ8AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4Q+T/B/ShDRR/l3aIAAAAAElFTkSuQmCC\" data-image-state=\"image-loaded\" width=\"764\" height=\"221\"\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = peacefulQueens(n)\r\n  y = f(n);\r\nend","test_suite":"%%\r\nn = 5;\r\nassert(isequal(peacefulQueens(n),12))\r\n\r\n%%\r\nn = 8;\r\nassert(isequal(peacefulQueens(n),42))\r\n\r\n%%\r\nn = 64;\r\nassert(isequal(peacefulQueens(n),3906))\r\n\r\n%%\r\nn = 4096;\r\nassert(isequal(peacefulQueens(n),16764930))\r\n\r\n%%\r\nn = 262144;\r\nassert(isequal(peacefulQueens(n),68718690306))\r\n\r\n%%\r\nn = 2097152;\r\nassert(isequal(peacefulQueens(n),4398040219650))\r\n\r\n%%\r\nn = 16777216;\r\nassert(isequal(peacefulQueens(n),281474926379010))\r\n\r\n%%\r\nm = randi(1000)+4;\r\ny = sum(arrayfun(@peacefulQueens,3:m));\r\nassert(isequal(y,polyval([1 3 2 0],m-2)/3))\r\n\r\n%%\r\nfiletext = fileread('peacefulQueens.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert') || contains(filetext,'switch') || contains(filetext,'regexp'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-07-02T17:52:57.000Z","deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-02T02:16:14.000Z","updated_at":"2026-01-26T15:48:57.000Z","published_at":"2022-07-02T02:17:02.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\u003eIn a 5x5 chessboard with a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Queen_(chess)#Placement_and_movement\\\"\u003e\u003cw:r\u003e\u003cw:t\u003equeen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e of one color (white, say) on the perimeter, one can place 12 black queens on the board such that none of the black queens can attack the white one (or vice versa). \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\u003eWrite a function that returns the number of queens that cannot attack a queen of the other color placed anywhere on the perimeter of an \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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\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\u003ex\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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\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 chessboard. \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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"221\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"764\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/oAAAEmCAYAAADShevcAAAAA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XfKyT7SvDKCaypaTKfRToNAsFu1fLAp9AAAAoBpyLfSZOQKqi5kjAAAAoBpyLfQBAAAAAEDf4mZ8AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4Q+T/B/ShDRR/l3aIAAAAAElFTkSuQmCC\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":45427,"title":"King's Cage","description":"Given the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Chess#Movement\u003e\r\n\r\nFor simplicity, numerical notation is used to represent the positions.","description_html":"\u003cp\u003eGiven the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Chess#Movement\"\u003ehttps://en.wikipedia.org/wiki/Chess#Movement\u003c/a\u003e\u003c/p\u003e\u003cp\u003eFor simplicity, numerical notation is used to represent the positions.\u003c/p\u003e","function_template":"function i = king(x,y)","test_suite":"%%\r\nx=[1,1];\r\ny=[5,5];\r\nassert(isequal( king(x,y),4))\r\n\r\n%%\r\nx=[6,6];\r\ny=[2,3];\r\nassert(isequal( king(x,y),4))\r\n\r\n%%\r\nx=[5,1];\r\ny=[5,5];\r\nassert(isequal( king(x,y),4))\r\n\r\n%%\r\nx=[2,3];\r\ny=[8,8];\r\nassert(isequal( king(x,y),6))\r\n\r\n%%\r\nx=[2,8];\r\ny=[7,1];\r\nassert(isequal( king(x,y),7))\r\n\r\n%%\r\nx=[1,4];\r\ny=[8,3];\r\nassert(isequal( king(x,y),7))\r\n\r\n\r\n%%\r\nx=[5,8];\r\ny=[5,8];\r\nassert(isequal( king(x,y),0))\r\n\r\n\r\n%%\r\nx=[1,4];\r\ny=[3,4];\r\nassert(isequal( king(x,y),2))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":363598,"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":"2020-04-07T06:55:52.000Z","updated_at":"2026-04-12T10:12:31.000Z","published_at":"2020-04-07T06:55:52.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 the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.\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/Chess#Movement\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Chess#Movement\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\u003eFor simplicity, numerical notation is used to represent the positions.\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":45240,"title":"Can the knight take out the pawn?","description":"* position of knight = k\r\n* position of pawns  = p\r\n\r\ncan the knight take out those pawns?\r\n\r\n* k='Nf4'\r\n* p={'g6','g7'}\r\n\r\nthen output should be [1,0]\r\n\r\n","description_html":"\u003cul\u003e\u003cli\u003eposition of knight = k\u003c/li\u003e\u003cli\u003eposition of pawns  = p\u003c/li\u003e\u003c/ul\u003e\u003cp\u003ecan the knight take out those pawns?\u003c/p\u003e\u003cul\u003e\u003cli\u003ek='Nf4'\u003c/li\u003e\u003cli\u003ep={'g6','g7'}\u003c/li\u003e\u003c/ul\u003e\u003cp\u003ethen output should be [1,0]\u003c/p\u003e","function_template":"function y = knight_move(k,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nk = 'Nd5';\r\np={'c3','c4','d3','e3','f4','f5','f6','g2','a5'}\r\ny_correct =  [1     0     0     1     1     0     1     0     0];\r\nassert(isequal(knight_move(k,p),y_correct))\r\n\r\n%%\r\nk = 'Ne3';\r\np={'c3','c4','d3','f4','f5','f6','g2','a5'}\r\ny_correct =  [0     1     0      0     1     0     1     0];\r\nassert(isequal(knight_move(k,p),y_correct))\r\n\r\n%%\r\nk = 'Na8';\r\np={'c3','a7','a6','b6','c6','b2','f6'}\r\ny_correct = [ 0     0     0     1     0     0     0];\r\nassert(isequal(knight_move(k,p),y_correct))\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":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-21T22:12:27.000Z","updated_at":"2026-01-23T13:26:38.000Z","published_at":"2019-12-21T22:18: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eposition of knight = k\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\u003eposition of pawns = p\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\u003ecan the knight take out those pawns?\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\u003ek='Nf4'\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\u003ep={'g6','g7'}\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 output should be [1,0]\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":45329,"title":"Castling-01","description":"Given the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Castling\u003e","description_html":"\u003cp\u003eGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Castling\"\u003ehttps://en.wikipedia.org/wiki/Castling\u003c/a\u003e\u003c/p\u003e","function_template":"function y = castling_01(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na={'Ra1','Ka7'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rh1'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rh1','Kh8'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rc1','Kh5'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rh1','Ke1'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Ra1','Rh1','Ke1'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rh1','Ke1'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rh5','Ke5'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra8','Ke8'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rd8','Rh8','Ke8'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rh8','Kd8'}\r\nassert(isequal(castling_01(a),0))","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":16,"test_suite_updated_at":"2020-02-15T23:25:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-15T12:59:18.000Z","updated_at":"2026-01-23T13:34:49.000Z","published_at":"2020-02-15T23:08: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\u003eGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or 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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Castling\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Castling\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\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":45336,"title":"chess position","description":"given the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For example,\r\n\r\n* 'Qd5' \u003e\u003e [3,4]\r\n\r\nNb. invalid ones should be represented by nan.\r\n","description_html":"\u003cp\u003egiven the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For example,\u003c/p\u003e\u003cul\u003e\u003cli\u003e'Qd5' \u0026gt;\u0026gt; [3,4]\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eNb. invalid ones should be represented by nan.\u003c/p\u003e","function_template":"function a = chess_pos(pos)\r\n  y = x;\r\nend","test_suite":"%%\r\npos={'Qe5','Rb2'}\r\na=[4,1;4,1]\r\nassert(isequal(chess_pos(pos),a))\r\n\r\n%%\r\npos={'a5','Nb8'}\r\na=[0,1;4,7]\r\nassert(isequal(chess_pos(pos),a))\r\n\r\n%%\r\npos={'Ng8'}\r\na=[6;7]\r\nassert(isequal(chess_pos(pos),a))\r\n\r\n%%\r\npos={'f1','Qb1','Bd9','c3','Rg7'}\r\na=[  5     1   NaN     2     6;\r\n     0     0   NaN     2     6]\r\nassert(isequaln(chess_pos(pos),a))\r\n\r\n%%\r\npos={'k1','Kc3','Rh9'}\r\na= [NaN     2   NaN\r\n   NaN     2   NaN]\r\nassert(isequaln(chess_pos(pos),a))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":"2020-02-17T05:55:18.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-16T23:12:04.000Z","updated_at":"2026-01-23T14:06:55.000Z","published_at":"2020-02-17T05:55: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 the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For 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\u003e'Qd5' \u0026gt;\u0026gt; [3,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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNb. invalid ones should be represented by nan.\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":3057,"title":"Chess performance","description":"After Problems \u003chttp://www.mathworks.com/matlabcentral/cody/problems/3054-chess-elo-rating-system/ 3054\u003e and \u003chttp://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/ 3056\u003e\r\n\r\n\r\nIn \u003chttp://en.wikipedia.org/wiki/Elo_rating_system Chess\u003e, performance isn't measured absolutely; it is inferred from wins (1), losses (0), and draws (0.5) against other players. A player's rating depends on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them.\r\n\r\nSupposing Player A was expected to score Ea points (but actually scored Sa).\r\n\r\nThe formula for updating his rating is :\r\n\r\n\u003c\u003chttp://upload.wikimedia.org/math/2/3/f/23fbcb658ac1e2565003c2190f28a21e.png\u003e\u003e\r\n\r\n* \r\n* \r\n\r\n\r\nThis update can be performed after each game or each tournament, or after any suitable rating period. \r\n\r\nSuppose Player A has a rating *Ra* of 1613, and plays in a five-round tournament. He (or she) loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score *Sa* is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score *Ea* , calculated according to the formula see in Problem 3056, was (0.506 + 0.686 + 0.785 + 0.539 + 0.351) = 2.867. Therefore the player's new rating *R'a* is (1613 + 32×(2.5 − 2.867)) = 1601. We assume that the *K* factor is always 32.\r\n\r\nI give you rating of Player A, ratings of their opponents and results. \r\n\r\nCompute the new rating (K = 32).\r\n\r\n\r\n","description_html":"\u003cp\u003eAfter Problems \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/3054-chess-elo-rating-system/\"\u003e3054\u003c/a\u003e and \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/\"\u003e3056\u003c/a\u003e\u003c/p\u003e\u003cp\u003eIn \u003ca href = \"http://en.wikipedia.org/wiki/Elo_rating_system\"\u003eChess\u003c/a\u003e, performance isn't measured absolutely; it is inferred from wins (1), losses (0), and draws (0.5) against other players. A player's rating depends on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them.\u003c/p\u003e\u003cp\u003eSupposing Player A was expected to score Ea points (but actually scored Sa).\u003c/p\u003e\u003cp\u003eThe formula for updating his rating is :\u003c/p\u003e\u003cimg src = \"http://upload.wikimedia.org/math/2/3/f/23fbcb658ac1e2565003c2190f28a21e.png\"\u003e\u003cul\u003e\u003cli\u003e\u003c/li\u003e\u003cli\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThis update can be performed after each game or each tournament, or after any suitable rating period.\u003c/p\u003e\u003cp\u003eSuppose Player A has a rating \u003cb\u003eRa\u003c/b\u003e of 1613, and plays in a five-round tournament. He (or she) loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score \u003cb\u003eSa\u003c/b\u003e is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score \u003cb\u003eEa\u003c/b\u003e , calculated according to the formula see in Problem 3056, was (0.506 + 0.686 + 0.785 + 0.539 + 0.351) = 2.867. Therefore the player's new rating \u003cb\u003eR'a\u003c/b\u003e is (1613 + 32×(2.5 − 2.867)) = 1601. We assume that the \u003cb\u003eK\u003c/b\u003e factor is always 32.\u003c/p\u003e\u003cp\u003eI give you rating of Player A, ratings of their opponents and results.\u003c/p\u003e\u003cp\u003eCompute the new rating (K = 32).\u003c/p\u003e","function_template":"function y = new_elo(opponents_elo,res,elo_playerA)\r\n  y = x;\r\nend","test_suite":"%%\r\nplayera=1613;\r\nelos=[1609 1477 1388 1586 1720];\r\nres=[0 0.5 1 1 0];\r\nassert(isequal(new_elo(elos,res,playera),1601))\r\n%%\r\nplayera=1613;\r\nelos=[1609 1477 1586 1720];\r\nres=[0 1 1 1];\r\nassert(isequal(new_elo(elos,res,playera),1642))\r\n%%\r\nplayera=1613;\r\nelos=[1613 1613 1613 1613 1613];\r\nres=[0.5 0.5 0.5 0.5 0.5];\r\nassert(isequal(new_elo(elos,res,playera),1613))\r\n%%\r\nassert(isequal(new_elo([1800 1900 2000 2100 2200],[1 0 1 0 1],1900),1935))\r\n%% My new ELO\r\nplayera=1800;\r\nelos=[1399 1280 2166 1534 1768 1791 1540];\r\nres=[1 1 0 1 1 0 1];\r\nassert(isequal(new_elo(elos,res,playera),1811))\r\n%% The last game was critical (-32 points if I lost)\r\nplayera=1800;\r\nelos=[1399 1280 2166 1534 1768 1791 1540];\r\nres=[1 1 0 1 1 0 0];\r\nassert(isequal(new_elo(elos,res,playera),1779))\r\n%% Perfect tournament ?\r\nplayera=1800;\r\nelos=[1399 1280 2166 1534 1768 1791 1540];\r\nres=[1 1 1 1 1 1 1];\r\nassert(isequal(new_elo(elos,res,playera),1875))\r\n%% Caruana in 2014 Sinquefield Cup (notice that K=16 for these guys)\r\ncaruana=2801;\r\nelos = [2772 2768 2877 2805 2787  2772 2768 2877 2787 2805];\r\nres = [1 1 1 1 1 1 1 0.5 0.5 0.5];\r\nassert(isequal(new_elo(elos,res,caruana),2913))","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":65,"test_suite_updated_at":"2015-03-02T20:49:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-28T23:49:25.000Z","updated_at":"2026-02-15T07:24:43.000Z","published_at":"2015-02-28T23:53: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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"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\u003eAfter Problems\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/3054-chess-elo-rating-system/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e3054\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e3056\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\u003eIn\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/Elo_rating_system\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eChess\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, performance isn't measured absolutely; it is inferred from wins (1), losses (0), and draws (0.5) against other players. A player's rating depends on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them.\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\u003eSupposing Player A was expected to score Ea points (but actually scored Sa).\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 formula for updating his rating is :\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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\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\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 update can be performed after each game or each tournament, or after any suitable rating period.\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 Player A has a rating\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\u003eRa\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of 1613, and plays in a five-round tournament. He (or she) loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score\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\u003eSa\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score\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\u003eEa\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , calculated according to the formula see in Problem 3056, was (0.506 + 0.686 + 0.785 + 0.539 + 0.351) = 2.867. Therefore the player's new rating\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\u003eR'a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is (1613 + 32×(2.5 − 2.867)) = 1601. We assume that the\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\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e factor is always 32.\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\u003eI give you rating of Player A, ratings of their opponents and results.\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\u003eCompute the new rating (K = 32).\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\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANYAAAAWBAMAAABOJX+pAAAAMFBMVEX///8wMDDMzMwEBASKiooWFhZiYmKenp62trbm5uZQUFBAQEAMDAwiIiJ0dHQAAAB7s/cyAAAAAXRSTlMAQObYZgAAAzpJREFUeNq9VllIVFEY/mZxFmfcSAxCdJSoJKkRCiQhhyAKhZrESerJjBRc6ELQAmJTQRAFjpAPLdaET5EPPmRRJA4aSQulBrYQNiHai+aQozkq2n/uMs7cOSMW1A/33P/cf/nO+ZdzLiCTyYZ/TVqFWXDjv1Hz3+2rak1ayeJG9MBkSo92oiLLz1EZnAhkPxJ4grJiz/mmS279CM0SvUlfa2OVGpp7sDEtlbE/byiZ+gU88/RzNyvA8pIrcABtFIkcloYhGJ5zdExBkvkkPkfO11II6CsL8Vz6PVjcyRU4YeqjSNAyoTuAeZ7SUgI9AVlfkLCMlYBQz01XNUlnI+YD4fgIKPbSu5AeN2Gu5xgbK2jolHiDV8KapZCOPOViHaOVfeEJsmH4xPJGy0QNPXZeiTtRCTmGIb+ElW9D2+gctyF6YX7Hc2MKmd8z62UPDe0foLiMIveAuRNKxdVIdehbHmv8HtawlIjO2tloNYzXdYGbirNZ7D3nIJAzQsFBXnP6O4YveJVJv4S1bdTcvSusMfNgRXt6yH6bV2FYeD01L2Kyip5vvbiXh1XdsvV0eHLtsPginJP8FtR5YRALKUFVG7pe9LDwpcjzQ2xwsiGXUZ74sQgG8VgSjevEfGm7ZbVYyh+QUWqZ4y6X64TLJcLlZ0EQm9QjRgaMN9xn7qYYTYrJfgIdTIqxdG5YtZI+IXaq8uW7B42DzXxpNJbSvuwQQ+wrwDDzEKQh9zPgugs0LrOgToUXak2g7mu4ohi3sm8aSu+M2AMx7ZxJUWJbNlod0TFcR8sLMn+Up2+A+QjxgiqzGrtkIBmnSzGkjOw3++WFqboIQfcd4NyMqvuoCBc1rJCov3YIuL6Z9u4pUzUMuWzzKMYPYX6rt5Rf9QiFeTT/8UYF1bX7xT795URox+vbYwQtiR+3IInWfauodOk4wTvqtkfqWMrrA0erphVj6t+IM9yEjDg3ghHJTtUZJZN5pYcFjK1irPdGfdxUPRgHqxJG+fBIVYseK4wBOLWKcZIt8l5Gyc10PlROFTa8ktiAWjauJCfDpu3wxjduirod4y5sVWJ3xFooKiDaTJs22/vnYHvW9g8gtvNvC0XkMLGLXXkAAAAASUVORK5CYII=\"}]}"},{"id":45330,"title":"Castling-02","description":"This is a follow up of problem \r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\u003e\r\n\r\n\r\nGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Castling\u003e","description_html":"\u003cp\u003eThis is a follow up of problem\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\"\u003ehttps://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\u003c/a\u003e\u003c/p\u003e\u003cp\u003eGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Castling\"\u003ehttps://en.wikipedia.org/wiki/Castling\u003c/a\u003e\u003c/p\u003e","function_template":"function tf=castling_02(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na={'Rd1','Rh1','Ke1'}\r\nassert(isequal(castling_02(a),1))\r\n%%\r\na={'Rd1','Rd4','Ke1','Bb6'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'d1','Rh8','Kg1'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'Ra1','Rh1','Ke1','Qd1'}\r\nassert(isequal(castling_02(a),1))\r\n%%\r\na={'Ra1','Rh1','Ke1','Qd1','Bg1'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'Ba2','Ra1','Rb1','Ke1','Bg1'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'Na1','Rh1','Ke1','Qd1'}\r\nassert(isequal(castling_02(a),1))\r\n%%\r\na={'Kd1','Qe1','Rh1','Rd8','a4','Nf2'}\r\nassert(isequal(castling_02(a),0))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-15T23:34:53.000Z","updated_at":"2026-01-23T13:53:26.000Z","published_at":"2020-02-15T23:38: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\u003eThis is a follow up of problem\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://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\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 position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or 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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Castling\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Castling\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\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":45236,"title":"Queen's move","description":"given a number of consecutive moves of queen, check for their validity based on their previous position....\r\nbut remember if u get an invalid move - u need check for the next move's validity based on the last valid position.....\r\n\r\n* x={'Qd1','Qd5','Qf7','Qa8','Qg8'}\r\n* y=[1,1,1,0,1]\r\n \r\n\u003chttps://en.wikipedia.org/wiki/Algebraic_notation_(chess)\u003e\r\n","description_html":"\u003cp\u003egiven a number of consecutive moves of queen, check for their validity based on their previous position....\r\nbut remember if u get an invalid move - u need check for the next move's validity based on the last valid position.....\u003c/p\u003e\u003cul\u003e\u003cli\u003ex={'Qd1','Qd5','Qf7','Qa8','Qg8'}\u003c/li\u003e\u003cli\u003ey=[1,1,1,0,1]\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Algebraic_notation_(chess)\"\u003ehttps://en.wikipedia.org/wiki/Algebraic_notation_(chess)\u003c/a\u003e\u003c/p\u003e","function_template":"function y = Queen_move(x)","test_suite":"%%\r\nx = {'Qd1','Qd5','Qf7','Qa8','Qg8'};\r\ny_correct = [1,1,1,0,1];\r\nassert(isequal(Queen_move(x),y_correct))\r\n%%\r\nx = {'Qd1','Qd5','Qf7','Qa8','Qc7'};\r\ny_correct = [1,1,1,0,1];\r\nassert(isequal(Queen_move(x),y_correct))\r\n%%\r\nx={'Qh1','Qg5','Qe6','Qe2','Qb3','Qd5','Qh7'};\r\ny_correct = [1,0,0,0,0,1,0];\r\nassert(isequal(Queen_move(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-20T16:33:40.000Z","updated_at":"2026-01-23T12:20:52.000Z","published_at":"2019-12-20T16:35: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\u003egiven a number of consecutive moves of queen, check for their validity based on their previous position.... but remember if u get an invalid move - u need check for the next move's validity based on the last valid position.....\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\u003ex={'Qd1','Qd5','Qf7','Qa8','Qg8'}\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\u003ey=[1,1,1,0,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/Algebraic_notation_(chess)\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Algebraic_notation_(chess\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\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":315,"title":"Valid Chess Moves","description":"Using standard Algebraic notation ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:\r\nMoving a pawn one space:\r\n('c5','c6') -\u003e true \r\n\r\nMoving a bishop non-diagonally:\r\n('Bb7','Bd7') -\u003e false","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: 175.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 87.5833px; transform-origin: 407px 87.5833px; 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: 384px 31.5px; text-align: left; transform-origin: 384px 31.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: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsing\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003estandard Algebraic notation\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 276.5px 8px; transform-origin: 276.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; 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 51.0833px; transform-origin: 404px 51.0833px; 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: 96px 8.5px; tab-size: 4; transform-origin: 96px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 8.5px; \"\u003eMoving \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 68px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 68px 8.5px; \"\u003ea pawn one space:\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: 80px 8.5px; tab-size: 4; transform-origin: 80px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e(\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 16px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 16px 8.5px; \"\u003e'c5'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e,\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 16px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 16px 8.5px; \"\u003e'c6'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e) -\u0026gt; true \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; tab-size: 4; 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: 124px 8.5px; tab-size: 4; transform-origin: 124px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 8.5px; \"\u003eMoving \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 96px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 96px 8.5px; \"\u003ea bishop non-diagonally:\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e(\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 20px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 20px 8.5px; \"\u003e'Bb7'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e,\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 20px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 20px 8.5px; \"\u003e'Bd7'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e) -\u0026gt; false\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = chessmove(x,y)\r\n  z = false;\r\nend","test_suite":"%%\r\nx = 'c5';\r\ny = 'c6';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'a2';\r\ny = 'a5';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'g3';\r\ny = 'h4';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Bb7';\r\ny = 'Bd7';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Bg2';\r\ny = 'Bh3';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Nf1';\r\ny = 'Ne3';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Nc5';\r\ny = 'Nc3';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Qb2';\r\ny = 'Qc4';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Qa1';\r\ny = 'Qh8';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Rh7';\r\ny = 'Rh3';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Rb2';\r\ny = 'Rh8';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Ke1';\r\ny = 'Ke2';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Kf3';\r\ny = 'Kg4';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Kb2';\r\ny = 'Kc4';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":1022,"edited_by":223089,"edited_at":"2022-05-23T10:24:16.000Z","deleted_by":null,"deleted_at":null,"solvers_count":85,"test_suite_updated_at":"2022-05-23T09:39:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-13T05:34:29.000Z","updated_at":"2026-03-30T18:59:55.000Z","published_at":"2012-02-13T05:35:32.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\u003eUsing\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estandard Algebraic notation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:\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[Moving a pawn one space:\\n('c5','c6') -\u003e true \\n\\nMoving a bishop non-diagonally:\\n('Bb7','Bd7') -\u003e false]]\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":45433,"title":"The Dark Knight","description":"  The current position of the knight is x \r\n  The desired destination is y\r\n The size of the chessboard is n.\r\n\r\nFind the minimum number of moves required by the knight to reach the destination.\r\n\r\nFor example, \r\n  \r\n x=[2,2]  y=[3,3] -- moves required = 2  \r\n   [2,2] \u003e [1,4] \u003e [3,3]\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003eThe current position of the knight is x \r\nThe desired destination is y\r\nThe size of the chessboard is n.\r\n\u003c/pre\u003e\u003cp\u003eFind the minimum number of moves required by the knight to reach the destination.\u003c/p\u003e\u003cp\u003eFor example,\u003c/p\u003e\u003cpre\u003e x=[2,2]  y=[3,3] -- moves required = 2  \r\n   [2,2] \u0026gt; [1,4] \u0026gt; [3,3]\u003c/pre\u003e","function_template":"function out = knight_step(x,y,n)","test_suite":"%%\r\nassert(isequal(knight_step([2,2],[3,3],8),2))\r\n%%\r\nassert(isequal(knight_step([2,2],[1,1],20),4))\r\n\r\n%%\r\nassert(isequal(knight_step([2,2],[8,8],12),4))\r\n\r\n%%\r\nassert(isequal(knight_step([2,2],[12,11],12),7))\r\n\r\n%%\r\nassert(isequal(knight_step([1,3],[8,3],8),5))\r\n%%\r\nassert(isequal(knight_step([1,3],[5,4],8),3))\r\n%%\r\nassert(isequal(knight_step([8,2],[1,2],8),5))\r\n\r\n%%\r\nassert(isequal(knight_step([8,7],[21,32],50),14))\r\n%%\r\nassert(isequal(knight_step([5,19],[5,19],20),0))\r\n%%\r\nassert(isequal(knight_step([5,19],[19,5],20),10))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":"2020-04-10T06:28:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-10T06:20:09.000Z","updated_at":"2026-01-21T12:55:02.000Z","published_at":"2020-04-10T06:28:31.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[The current position of the knight is x \\nThe desired destination is y\\nThe size of the chessboard is n.]]\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\u003eFind the minimum number of moves required by the knight to reach the destination.\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=[2,2]  y=[3,3] -- moves required = 2  \\n   [2,2] \u003e [1,4] \u003e [3,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":45238,"title":"Checkmate","description":"* The positions of different chess pieces are given in a cell  *p* . \r\n* The position of the king is given as *x*\r\n\r\nDetermine if the opponent king is in check for individual scenerios.\r\n\r\n* x='Kg7'\r\n* p={'Qe5','Qg5','Qb5','Qa7'}\r\n\r\noutput= [1,1,0,1]\r\n\r\nN.b.any invalid position should produce 0.\r\nu may imagine p as the white pieces and x as the black king for clarity.","description_html":"\u003cul\u003e\u003cli\u003eThe positions of different chess pieces are given in a cell  \u003cb\u003ep\u003c/b\u003e .\u003c/li\u003e\u003cli\u003eThe position of the king is given as \u003cb\u003ex\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eDetermine if the opponent king is in check for individual scenerios.\u003c/p\u003e\u003cul\u003e\u003cli\u003ex='Kg7'\u003c/li\u003e\u003cli\u003ep={'Qe5','Qg5','Qb5','Qa7'}\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eoutput= [1,1,0,1]\u003c/p\u003e\u003cp\u003eN.b.any invalid position should produce 0.\r\nu may imagine p as the white pieces and x as the black king for clarity.\u003c/p\u003e","function_template":"function y=checkmate(x,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nx='Kg7';\r\np={'Qe5','Qg5','Qb5','Qa7'}\r\ny_correct = [1,1,0,1];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Kg7';\r\np={'Qe5','Rg5','Bb5','Na7','h6'}\r\ny_correct = [1,1,0,0,1];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Ka3';\r\np={'Qe5','Rg5','Bb5','Na7','h6'}\r\ny_correct = [0,0,0,0,0];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Ka3';\r\np={'a2','Rg5','Be7','Nc4','Nb1'}\r\ny_correct = [0,0,1,1,1];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Ka3';\r\np={'a2','Rg5','Be7','Nc5','Kb2'}\r\ny_correct = [0,0,1,0,0];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Kf2';\r\np={'Ra2','Rg5','Bh4','Bg1','Nd3','Kf3','Ng1','e1','Qg4','Qf7'}\r\ny_correct = [1,0,1,1,1,0,0,0,0,1];\r\nassert(isequal(checkmate(x,p),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-21T00:09:28.000Z","updated_at":"2026-01-23T12:59:27.000Z","published_at":"2019-12-21T00:12:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe positions of different chess pieces are given in a cell \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\u003ep\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=\\\"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 position of the king is given as\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\u003ex\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\u003eDetermine if the opponent king is in check for individual scenerios.\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\u003ex='Kg7'\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\u003ep={'Qe5','Qg5','Qb5','Qa7'}\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= [1,1,0,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\u003eN.b.any invalid position should produce 0. u may imagine p as the white pieces and x as the black king for clarity.\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":306,"title":"Eight Queens Solution Checker","description":"Write a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic eight queens problem.\r\nIn the eight queens problem, eight queens must be placed on a chessboard such that no two queens attack each other. That is, no two queens can share the same row, column, or diagonal. The diagram below is one possible solution:\r\n\r\nYour function should take an 8-by-8 matrix of 0s and 1s, where the 1s represent the position of the queens, and return a logical 1 if the solution is valid or a logical 0 otherwise.\r\nEXAMPLE 1\r\n   in1 = [ ...\r\n       0 0 0 1 0 0 0 0\r\n       0 0 0 0 0 0 1 0\r\n       0 0 1 0 0 0 0 0\r\n       0 0 0 0 0 0 0 1\r\n       0 1 0 0 0 0 0 0\r\n       0 0 0 0 1 0 0 0\r\n       1 0 0 0 0 0 0 0\r\n       0 0 0 0 0 1 0 0 ];\r\n\r\n   isEightQueensSolution(in1)\r\nreturns 1.\r\nEXAMPLE 2\r\n   in2 = [ ...\r\n       0 0 0 1 0 0 0 0\r\n       0 0 0 0 0 0 1 0\r\n       0 0 1 0 0 0 0 0\r\n       0 0 0 0 0 0 0 1\r\n       0 1 0 0 0 0 0 0\r\n       1 0 0 0 0 0 0 0\r\n       0 0 0 0 1 0 0 0\r\n       0 0 0 0 0 1 0 0 ];\r\n\r\n   isEightQueensSolution(in2)\r\nreturns 0. (Notice that the queens on the bottom two rows share a diagonal.)","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: 1032.03px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 516.017px; transform-origin: 407px 516.017px; 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: 343.5px 8px; transform-origin: 343.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eeight queens problem\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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; 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: 377.5px 8px; transform-origin: 377.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the eight queens problem, eight queens must be placed on a chessboard such that no two queens attack each other. That is, no two queens can share the same row, column, or diagonal. The diagram below is one possible solution:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 287.5px; 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 143.75px; text-align: center; transform-origin: 384px 143.75px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARoAAAEaCAIAAABB0Q/tAAAXF0lEQVR42u2de2xVVdrGe6X0tKXtodRS6rHtqYci6MBQoZCGaYDwqcOIgwQQIVSFMioKgToIRjJgIChyB8XCAFViJhnjhcmIcdAQnBj+KF4y/uGFQWIMIpLSeKmkgHxPu5jFbu33TTzdhdOu385mZ593v2vlPH3XL2uvczj7iXuGjY3Npy1O/y5ebLwy+6C6Z6/MjiIUXXlF4IQiFIFTty3VwB2bw2tX6sjgAydK9QsUFa9efu3i+ZHt622kcMXS5H45cXFxOurcxiPPrCt4eJ7ywQmcKFUHe+6MKUkpKcFgMDm3X8m6VSYYGFy6cOHCr776Skedm6Amq6S+2cpUvlqBEzi5XqqBz23oP2dW/7mzzVxUumtrQiD1pZdeam5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pE6V0RxYxRpcFKr9FajSPVDqVDkOk5TpkwyRpHl5WVaHRmcGhsbs7Ky6usPzp9fbY0iq6pmKKK4MYpUpvLVyhhFqh9KhSLXcVq9erk1ity5c8vo0SOsUWR1dZXmImsUGYmEFbFGkcpUvjWKVD+UCkWu47R3b60vRpHqh1KhyHWcDh3a74tRpPerKkqFIkdxamg47otRpP2onVKhyF2cmppOBoPZnTSKVA8//7kupUKRiz8fXLTowU4aRaoHSoUicGrZT578LC8vN2qjSLVVD5QKReB0aV+5clnURpFqS6lQBE6X98OHD0RtFKm2lApF4HR5b24+HbVRpHlWBKVCETi1wSk6o0hwQhE4tdnffvtvURtFqi2lQhE4tXn2Q9RGke2eLUGpUOQ6TuXlZVEbRaotpUIROF3az59vqKqaEQikRmEUmZSUOH36nR0unygVitx9qPLp08f27q1dtOjBCRPGDhkyKBjMzsrKbPd/YRVRvLAwpBxlKr/DL3ApFYp45H8Hs9bRo+97d/v0FUqFInDC3wlFKAInBh+KYhMn/oIoQlHnd3BCEYrAicEXM4pwdgUnFEWjCGdXcEKRP4pwdgUnFEWpCGdXcAInfxTh7ApO4OSbIpxdwQmcfFOEsys4gZOfinB2BSdw8lMRzq7gBE5+KsLZFZzAyTdFOLuCEzj5qQhnV3ACJ98U4ewKTuDkmyKcXcEJnHxThLMrOIGTb4pwdgUncPJNEc6u4AROvinC2RWcwMk3RTi7ghM4+akIZ1dwQpFvinB2BScU+akIZ1dwQpFvinB2BScU+aYIZ1dwQpHPOOHsCk4o8kERzq7ghCLfFOHsCk4o8k0Rzq7ghCJ/FOHsCk4o8lkRzq7ghKIuVISzKzihCEXgxOBDUXfBiY2NzZftfwHAyDu2GXeLKAAAAABJRU5ErkJggg==\" data-image-state=\"image-loaded\"\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; 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: 380px 8px; transform-origin: 380px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYour function should take an 8-by-8 matrix of 0s and 1s, where the 1s represent the position of the queens, and return a logical 1 if the solution is valid or a logical 0 otherwise.\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: 39px 8px; transform-origin: 39px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eEXAMPLE 1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 224.767px; 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 112.383px; transform-origin: 404px 112.383px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 44px 8.5px; transform-origin: 44px 8.5px; \"\u003e   in1 = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); perspective-origin: 12px 8.5px; text-decoration: none; text-decoration-color: rgb(14, 0, 255); text-emphasis-color: rgb(14, 0, 255); transform-origin: 12px 8.5px; \"\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 1 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 1 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 1 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 0 1\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 1 0 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 1 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       1 0 0 0 0 0 0 0\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: 100px 8.5px; tab-size: 4; transform-origin: 100px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 1 0 0 ];\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; tab-size: 4; 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: 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; \"\u003e   isEightQueensSolution(in1)\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: 30.5px 8px; transform-origin: 30.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ereturns 1.\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: 39px 8px; transform-origin: 39px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eEXAMPLE 2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 224.767px; 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 112.383px; transform-origin: 404px 112.383px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 44px 8.5px; transform-origin: 44px 8.5px; \"\u003e   in2 = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); perspective-origin: 12px 8.5px; text-decoration: none; text-decoration-color: rgb(14, 0, 255); text-emphasis-color: rgb(14, 0, 255); transform-origin: 12px 8.5px; \"\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 1 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 1 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 1 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 0 1\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 1 0 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       1 0 0 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 1 0 0 0\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: 100px 8.5px; tab-size: 4; transform-origin: 100px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 1 0 0 ];\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; tab-size: 4; 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: 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; \"\u003e   isEightQueensSolution(in2)\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: 240px 8px; transform-origin: 240px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ereturns 0. (Notice that the queens on the bottom two rows share a diagonal.)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = isEightQueensSolution(x)\r\n  y = x;\r\nend","test_suite":"%% Eight Queens Solution Checker Test Suite\r\n\r\n%%\r\n% Unique solution #6 from \r\n% http://en.wikipedia.org/wiki/Eight_queens_puzzle\r\nin1 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout1 = isEightQueensSolution(in1);\r\nassert(islogical(out1));\r\nassert(isequal(out1, 1));\r\n\r\n%%\r\n% Unique solution #7\r\nin2 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    0 0 0 1 0 0 0 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout2 = isEightQueensSolution(in2);\r\nassert(isequal(out2, 1));\r\n\r\n%%\r\n% Unique solution #10\r\nin3 = [ ...\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0 ];\r\nout3 = isEightQueensSolution(in3);\r\nassert(isequal(out3, 1));\r\n\r\n%%\r\n% Unique solution #11\r\nin4 = [ ...\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 1 0 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 0 1 0 0 0 0 0 ];\r\nout4 = isEightQueensSolution(in4);\r\nassert(isequal(out4, 1));\r\n\r\n%%\r\nin5 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout5 = isEightQueensSolution(in5);\r\nassert(isequal(out5, 0));\r\n\r\n%%\r\nin6 = [ ...\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    0 0 0 1 0 0 0 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout6 = isEightQueensSolution(in6);\r\nassert(isequal(out6, 0));\r\n\r\n%%\r\nin7 = [ ...\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 1 0 0 0 ];\r\nout7 = isEightQueensSolution(in7);\r\nassert(isequal(out7, 0));\r\n\r\n%%\r\nin8 = [ ...\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 1 0 0 1\r\n    0 0 0 0 0 0 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 0 1 0 0 0 0 0 ];\r\nout8 = isEightQueensSolution(in8);\r\nassert(isequal(out8, 0));\r\n\r\n%%\r\n% Only 7 queens\r\nin9 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout9 = isEightQueensSolution(in9);\r\nassert(isequal(out9, 0));\r\n\r\n%%\r\n% Row and column constraint satisfied but \r\n% not diagonal constraint.\r\nin10 = eye(8);\r\nout10 = isEightQueensSolution(in10);\r\nassert(isequal(out10, 0));\r\n\r\n%%\r\n% Row and column constraint satisfied but \r\n% not diagonal constraint.\r\nin10 = flip(eye(8));\r\nout10 = isEightQueensSolution(in10);\r\nassert(isequal(out10, 0));","published":true,"deleted":false,"likes_count":6,"comments_count":2,"created_by":4303371,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":168,"test_suite_updated_at":"2022-01-07T08:34:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-11T12:21:25.000Z","updated_at":"2026-03-23T21:10:35.000Z","published_at":"2012-02-11T12:55:24.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\u003eWrite a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eeight queens 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\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\u003eIn the eight queens problem, eight queens must be placed on a chessboard such that no two queens attack each other. That is, no two queens can share the same row, column, or diagonal. The diagram below is one possible solution:\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=\\\"center\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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\u003eYour function should take an 8-by-8 matrix of 0s and 1s, where the 1s represent the position of the queens, and return a logical 1 if the solution is valid or a logical 0 otherwise.\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\u003eEXAMPLE 1\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[   in1 = [ ...\\n       0 0 0 1 0 0 0 0\\n       0 0 0 0 0 0 1 0\\n       0 0 1 0 0 0 0 0\\n       0 0 0 0 0 0 0 1\\n       0 1 0 0 0 0 0 0\\n       0 0 0 0 1 0 0 0\\n       1 0 0 0 0 0 0 0\\n       0 0 0 0 0 1 0 0 ];\\n\\n   isEightQueensSolution(in1)]]\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\u003ereturns 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEXAMPLE 2\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[   in2 = [ ...\\n       0 0 0 1 0 0 0 0\\n       0 0 0 0 0 0 1 0\\n       0 0 1 0 0 0 0 0\\n       0 0 0 0 0 0 0 1\\n       0 1 0 0 0 0 0 0\\n       1 0 0 0 0 0 0 0\\n       0 0 0 0 1 0 0 0\\n       0 0 0 0 0 1 0 0 ];\\n\\n   isEightQueensSolution(in2)]]\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\u003ereturns 0. (Notice that the queens on the bottom two rows share a diagonal.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARoAAAEaCAIAAABB0Q/tAAAXF0lEQVR42u2de2xVVdrGe6X0tKXtodRS6rHtqYci6MBQoZCGaYDwqcOIgwQQIVSFMioKgToIRjJgIChyB8XCAFViJhnjhcmIcdAQnBj+KF4y/uGFQWIMIpLSeKmkgHxPu5jFbu33TTzdhdOu385mZ593v2vlPH3XL2uvczj7iXuGjY3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KzihCEXgxOBDUXfBiY2NzZftfwHAyDu2GXeLKAAAAABJRU5ErkJggg==\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":45237,"title":"Queen's move - 02","description":"In continuation with the problem-45236 ... \r\nIn the previous problem, it was assumed that there were no other chess pieces on the board... Now lets assume there is a number of king present on the board whose location is given in an array *p* . Now, check for the validity of Queen's moves.\r\n\r\n# x={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'}\r\n# p={'Kd4','Ke5','Kh7','Ke7'}\r\n\r\noutput=[1,1,0,1,0,1,1,0,0,0]\r\n\r\nkindly see this problem for understanding\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\u003e\r\n","description_html":"\u003cp\u003eIn continuation with the problem-45236 ... \r\nIn the previous problem, it was assumed that there were no other chess pieces on the board... Now lets assume there is a number of king present on the board whose location is given in an array \u003cb\u003ep\u003c/b\u003e . Now, check for the validity of Queen's moves.\u003c/p\u003e\u003col\u003e\u003cli\u003ex={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'}\u003c/li\u003e\u003cli\u003ep={'Kd4','Ke5','Kh7','Ke7'}\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eoutput=[1,1,0,1,0,1,1,0,0,0]\u003c/p\u003e\u003cp\u003ekindly see this problem for understanding \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\u003c/a\u003e\u003c/p\u003e","function_template":"function z = Queen_move_3(x,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nx={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'};\r\np={'Kd4','Ke5','Kh7','Ke7'};\r\ny_correct = [1,1,0,1,0,1,1,0,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qd1','Qd5','Qf1','Qa8','Qf7','Qb2','Qc7'};\r\np={'Kd4','Ke5','Kh7','Ke7'};\r\ny_correct = [1,0,1,0,1,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qh7','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7'};\r\np={'Kd4','Ke5','Kh7','Ke7'};\r\ny_correct = [0,0,0,0,0,0,0,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qh7','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7'};\r\np={'Ka8','Kb2','Kd7','Kf3','Kg6'};\r\ny_correct = [1,1,1,0,0,0,0,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qh7','Qh1','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qg2','Qg7','Qf1','Qf7','Qf2','Qa2'};\r\np={'Ka8','Kb2','Kd7','Kf3','Kg6'};\r\ny_correct = [1,1,0,0,0,0,0,0,1,0,1,0,1,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-20T23:00:44.000Z","updated_at":"2026-01-23T12:47:14.000Z","published_at":"2019-12-20T23:01: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\u003eIn continuation with the problem-45236 ... In the previous problem, it was assumed that there were no other chess pieces on the board... Now lets assume there is a number of king present on the board whose location is given in an array\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\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . Now, check for the validity of Queen's moves.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'}\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ep={'Kd4','Ke5','Kh7','Ke7'}\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=[1,1,0,1,0,1,1,0,0,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\u003ekindly see this problem for understanding\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/45236-queen-s-move\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\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\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":45332,"title":"Castling-03","description":"Given the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (white king).\r\n\r\n* a=position of white pieces\r\n* b=position of black pieces\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Castling\u003e\r\n\r\nPrevious problem \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\u003e\r\n\r\n\r\n","description_html":"\u003cp\u003eGiven the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (white king).\u003c/p\u003e\u003cul\u003e\u003cli\u003ea=position of white pieces\u003c/li\u003e\u003cli\u003eb=position of black pieces\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Castling\"\u003ehttps://en.wikipedia.org/wiki/Castling\u003c/a\u003e\u003c/p\u003e\u003cp\u003ePrevious problem \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\u003c/a\u003e\u003c/p\u003e","function_template":"function tf=castling_03(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\na={'Rd1','Rh1','Ke1'}\r\n b={'Nc6','Bg1','g5','Rh8'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Rd1','Rh1','Ke1'}\r\nb={'Nc6','d3','g5','Rh8','Qb8'}\r\nassert(isequal(castling_03(a,b),1))\r\n\r\n%%\r\na={'Qe1','Rh1','Kd2','Nf7'}\r\nb={'Nc6','d3','g5','Rh8','Qb8'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Qe1','Rh1','Kd2','Nf7'}\r\nb={'Nc6','d3','g5','Rh8','Qc1'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Qf1','Rh1','Ra1','Ke1'}\r\nb={'Ng1','h3','Rg5','Nb1','Qa8'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Qf1','Rh1','Ra1','Ke1'}\r\nb={'Ng1','h3','Rg5','Nb5','Qa8'}\r\nassert(isequal(castling_03(a,b),1))\r\n\r\n%%\r\na={'Qf1','Rh1','Ra1','Ke1'}\r\n b={'Ba8','Bg7','Rh6','Rb2'}\r\nassert(isequal(castling_03(a,b),1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-16T12:59:11.000Z","updated_at":"2026-01-23T14:02:57.000Z","published_at":"2020-02-16T13:24:25.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 the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (white king).\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=position of white pieces\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\u003eb=position of black pieces\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/Castling\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Castling\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\u003ePrevious 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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\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\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":45418,"title":"En passant - 01","description":"This is white's turn. The player moves his pawn.\r\n\r\nThe pawn's previous and current positions are given.\r\n\r\nDetermine whether the move was valid.\r\n\r\n pawn's previous pos = 'b2'\r\n pawn's previous pos = 'c3'\r\n\r\nSo this is a valid move provided there was an opponent piece on c3.\r\n\r\nBut for now, just check the validity of the move. Opponent's pieces will be added in the next problem.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Chess#Movement\u003e\r\n","description_html":"\u003cp\u003eThis is white's turn. The player moves his pawn.\u003c/p\u003e\u003cp\u003eThe pawn's previous and current positions are given.\u003c/p\u003e\u003cp\u003eDetermine whether the move was valid.\u003c/p\u003e\u003cpre\u003e pawn's previous pos = 'b2'\r\n pawn's previous pos = 'c3'\u003c/pre\u003e\u003cp\u003eSo this is a valid move provided there was an opponent piece on c3.\u003c/p\u003e\u003cp\u003eBut for now, just check the validity of the move. Opponent's pieces will be added in the next problem.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Chess#Movement\"\u003ehttps://en.wikipedia.org/wiki/Chess#Movement\u003c/a\u003e\u003c/p\u003e","function_template":"function tf = en_passant(w1,w2)","test_suite":"%%\r\nassert(isequal(en_passant('b2','c3'),1))\r\n%%\r\nassert(isequal(en_passant('a2','a3'),1))\r\n%%\r\nassert(isequal(en_passant('d3','d5'),0))\r\n%%\r\nassert(isequal(en_passant('e5','d4'),0))\r\n%%\r\nassert(isequal(en_passant('e5','c6'),0))\r\n%%\r\nassert(isequal(en_passant('e5','d6'),1))\r\n%%\r\nassert(isequal(en_passant('b2','b4'),1))\r\n%%\r\nassert(isequal(en_passant('b2','c2'),0))\r\n%%\r\nassert(isequal(en_passant('a1','a2'),0))\r\n%%\r\nassert(isequal(en_passant('g7','g8'),1))\r\n%%\r\nassert(isequal(en_passant('g7','g6'),0))\r\n%%\r\nassert(isequal(en_passant('f5','h6'),0))\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":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-02T03:21:50.000Z","updated_at":"2026-01-23T14:14:44.000Z","published_at":"2020-04-02T03:23:17.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 white's turn. The player moves his pawn.\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 pawn's previous and current positions are given.\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\u003eDetermine whether the move was valid.\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[ pawn's previous pos = 'b2'\\n pawn's previous pos = 'c3']]\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\u003eSo this is a valid move provided there was an opponent piece on c3.\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\u003eBut for now, just check the validity of the move. Opponent's pieces will be added in the next problem.\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/Chess#Movement\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Chess#Movement\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\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":113,"title":"N-Queens Checker","description":"Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix, a, filled mostly with zeros, while the queens are given as ones. Your job is to verify that the board is a legitimate answer to the \u003chttp://en.wikipedia.org/wiki/Eight_queens_puzzle N-Queens problem\u003e. The board is good only when no queen can \"see\" (and thus capture) another queen.\r\n\r\nExample\r\n\r\nThe matrix below shows two queens on a 3-by-3 chessboard. The queens can't see each other, so the function should return TRUE.\r\n\r\n 1 0 0\r\n 0 0 1\r\n 0 0 0\r\n\r\nHere is a bigger board with more queens. Since the queens on rows 3 and 4 are adjacent along a diagonal, they can see each other and the function should return FALSE.\r\n\r\n 0 0 0 1\r\n 1 0 0 0\r\n 0 0 1 0 \r\n 0 1 0 0\r\n\r\nThe board doesn't have to be square, but it always has 2 or more rows and 2 or more columns. This matrix returns FALSE.\r\n\r\n 1 0 0 0 0 \r\n 0 0 0 1 1\r\n","description_html":"\u003cp\u003ePicture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix, a, filled mostly with zeros, while the queens are given as ones. Your job is to verify that the board is a legitimate answer to the \u003ca href=\"http://en.wikipedia.org/wiki/Eight_queens_puzzle\"\u003eN-Queens problem\u003c/a\u003e. The board is good only when no queen can \"see\" (and thus capture) another queen.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003eThe matrix below shows two queens on a 3-by-3 chessboard. The queens can't see each other, so the function should return TRUE.\u003c/p\u003e\u003cpre\u003e 1 0 0\r\n 0 0 1\r\n 0 0 0\u003c/pre\u003e\u003cp\u003eHere is a bigger board with more queens. Since the queens on rows 3 and 4 are adjacent along a diagonal, they can see each other and the function should return FALSE.\u003c/p\u003e\u003cpre\u003e 0 0 0 1\r\n 1 0 0 0\r\n 0 0 1 0 \r\n 0 1 0 0\u003c/pre\u003e\u003cp\u003eThe board doesn't have to be square, but it always has 2 or more rows and 2 or more columns. This matrix returns FALSE.\u003c/p\u003e\u003cpre\u003e 1 0 0 0 0 \r\n 0 0 0 1 1\u003c/pre\u003e","function_template":"function tf = queens(a)\r\n  tf = true;\r\nend","test_suite":"%%\r\n\r\na = [1 0 0; 0 0 1; 0 0 0];\r\ntf_correct = true;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [0 0 0 1; 1 0 0 0; 0 0 1 0; 0 1 0 0];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0 0 0 0; 0 0 0 1 1];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n\r\n%%\r\n\r\na = [ ...\r\n  0 0 1 0 0 0 0 0; 0 0 0 0 0 0 1 0; 0 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 1;\r\n  0 0 0 0 0 1 0 0; 0 0 0 1 0 0 0 0; 1 0 0 0 0 0 0 0; 0 0 0 0 1 0 0 0];\r\ntf_correct = true;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = ones(15,7);\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = zeros(20,23);\r\na(1,22) = 1;\r\na(2,23) = 1;\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0; 0 1];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0 1; 0 0 0; 0 1 0];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":311,"test_suite_updated_at":"2017-03-15T16:59:10.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2012-01-26T20:33:45.000Z","updated_at":"2026-03-23T21:08:43.000Z","published_at":"2012-01-30T15: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\u003ePicture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix, a, filled mostly with zeros, while the queens are given as ones. Your job is to verify that the board is a legitimate answer to 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://en.wikipedia.org/wiki/Eight_queens_puzzle\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eN-Queens problem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The board is good only when no queen can \\\"see\\\" (and thus capture) another queen.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe matrix below shows two queens on a 3-by-3 chessboard. The queens can't see each other, so the function should return TRUE.\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[ 1 0 0\\n 0 0 1\\n 0 0 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\u003eHere is a bigger board with more queens. Since the queens on rows 3 and 4 are adjacent along a diagonal, they can see each other and the function should return FALSE.\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[ 0 0 0 1\\n 1 0 0 0\\n 0 0 1 0 \\n 0 1 0 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\u003eThe board doesn't have to be square, but it always has 2 or more rows and 2 or more columns. This matrix returns FALSE.\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[ 1 0 0 0 0 \\n 0 0 0 1 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":45389,"title":"Knight's Watch","description":"  \"Night gathers, and now my watch begins\"\r\n\r\nA knight is placed on an n-by-n sized chessboard at the position x. Find the probability that after k steps, the knight will remain within the chessboard.\r\n\r\nAny knight's move that places him outside the board should be considered invalid.\r\n\r\n For simplicity, the knight's position on the chessboard is defined with the numeric\r\n notation instead of algebraic notation. so 'Ka1' is represented as (1,1).\r\n\r\nBrief explanation:\r\n\r\n  Say the knight is placed in pos-(1,1). A knight has 8 possible moves. So in the next move, \r\nthe Knight can go to 8 different positions in the chessboard. But among them, only 2\r\n positions are valid i.e. the knight remains within the chessboard and they are -\r\n(3,2) \u0026 (2,3). So the prob. is 2/8 after 1 move. What will be the probability after k moves?\r\n\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003e\"Night gathers, and now my watch begins\"\r\n\u003c/pre\u003e\u003cp\u003eA knight is placed on an n-by-n sized chessboard at the position x. Find the probability that after k steps, the knight will remain within the chessboard.\u003c/p\u003e\u003cp\u003eAny knight's move that places him outside the board should be considered invalid.\u003c/p\u003e\u003cpre\u003e For simplicity, the knight's position on the chessboard is defined with the numeric\r\n notation instead of algebraic notation. so 'Ka1' is represented as (1,1).\u003c/pre\u003e\u003cp\u003eBrief explanation:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eSay the knight is placed in pos-(1,1). A knight has 8 possible moves. So in the next move, \r\nthe Knight can go to 8 different positions in the chessboard. But among them, only 2\r\npositions are valid i.e. the knight remains within the chessboard and they are -\r\n(3,2) \u0026 (2,3). So the prob. is 2/8 after 1 move. What will be the probability after k moves?\r\n\u003c/pre\u003e","function_template":"function prob = knights_watch(x,n,k)","test_suite":"%%\r\nx =[1,1];\r\nassert(isequal(knights_watch(x,3,2),0.0625))\r\n%%\r\nx =[1,1];\r\nassert(isequal(knights_watch(x,4,4),0.0176))\r\n%%\r\nx =[6,4];\r\nassert(isequal(knights_watch(x,6,9),0.012))\r\n%%\r\nx =[6,4];\r\nassert(isequal(knights_watch(x,8,25),0.0011))\r\n%%\r\nx =[8,8];\r\nassert(isequal(knights_watch(x,8,15),0.0042))\r\n%%\r\nx =[8,8];\r\nassert(isequal(knights_watch(x,16,15),0.4666))\r\n%%\r\nx =[3,1];\r\nassert(isequal(knights_watch(x,16,50),0.0037))","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":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-25T18:55:22.000Z","updated_at":"2026-01-23T12:14:39.000Z","published_at":"2020-03-25T18:55:22.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\\\"Night gathers, and now my watch begins\\\"]]\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\u003eA knight is placed on an n-by-n sized chessboard at the position x. Find the probability that after k steps, the knight will remain within the chessboard.\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\u003eAny knight's move that places him outside the board should be considered invalid.\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[ For simplicity, the knight's position on the chessboard is defined with the numeric\\n notation instead of algebraic notation. so 'Ka1' is represented as (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\u003eBrief explanation:\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[Say the knight is placed in pos-(1,1). A knight has 8 possible moves. So in the next move, \\nthe Knight can go to 8 different positions in the chessboard. But among them, only 2\\npositions are valid i.e. the knight remains within the chessboard and they are -\\n(3,2) \u0026 (2,3). So the prob. is 2/8 after 1 move. What will be the probability after k moves?]]\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":45239,"title":"Checkmate-02","description":"This is an extension of the problem \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\u003e\r\n\r\nIf the king is in check, examine the next move of the king. List all those possible moves by which king can avoid the check by the next move.\r\n\r\nOtherwise 'checkmate'.\r\n\r\n* r = king's location\r\n* p = position of opponent's pieces\r\n\r\n* if the king is currently not in check, then he doesn't need to move. so return empty. \r\n\r\n* for simplicity, assume that the king cannot take out opponent's pieces.\r\n","description_html":"\u003cp\u003eThis is an extension of the problem \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\u003c/a\u003e\u003c/p\u003e\u003cp\u003eIf the king is in check, examine the next move of the king. List all those possible moves by which king can avoid the check by the next move.\u003c/p\u003e\u003cp\u003eOtherwise 'checkmate'.\u003c/p\u003e\u003cul\u003e\u003cli\u003er = king's location\u003c/li\u003e\u003cli\u003ep = position of opponent's pieces\u003c/li\u003e\u003c/ul\u003e\u003cul\u003e\u003cli\u003eif the king is currently not in check, then he doesn't need to move. so return empty.\u003c/li\u003e\u003c/ul\u003e\u003cul\u003e\u003cli\u003efor simplicity, assume that the king cannot take out opponent's pieces.\u003c/li\u003e\u003c/ul\u003e","function_template":"function pos=checkmate_2(r,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nr = 'Kd4';\r\np={'Qe3','Rh3','Nc1','c6'};\r\npos = {'Kd5','Kc4'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kg6';\r\np={'Qe3','Rh3','Nc1','c6','Ke7'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kc8';\r\np={'Qe3','Rh3','Nc1','c6','Ke7','h5','Ba6'};\r\npos = {'Kc7','Kb8'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kh1';\r\np={'Qa3','Rb3','Nf2','c6','Kf7','h5','Ba6'};\r\npos = {'Kh2','Kg2','Kg1'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kg6';\r\np={'Qe3','Rh3','Nc1','c6'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kd4';\r\np={'Rh2','Na1','d1'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kb2';\r\np={'Na2','Na1','Na3'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kb2';\r\np={'Na2','Na1','Na3','c1','c3'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kb2';\r\np={'Na2','Na1','Na3','Bg7' };\r\npos = 'checkmate';\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kg6';\r\np={'Nf5','Rg1','g4','Qe2','Bf1','Kc3' };\r\npos =  {'Kh7','Kf7','Kf6'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Ka1';\r\np={'Qa3','Rb3','Nf2','c6','Kf7','h5','Ba6'};\r\npos =  'checkmate';\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nfiletext = fileread('checkmate_2.m');\r\nassert(isempty(strfind(filetext, 'regexp')),'regexp() forbidden')\r\nassert(isempty(strfind(filetext, 'regexprep')),'regexprep() forbidden')\r\nassert(isempty(strfind(filetext, 'strfind')),'strfind() forbidden')\r\nassert(isempty(strfind(filetext, 'strcmp')),'strcmp() forbidden')\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":14,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2019-12-29T04:16:28.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-21T01:40:07.000Z","updated_at":"2026-01-23T13:22:55.000Z","published_at":"2019-12-21T21:38:46.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 an extension of the 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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\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\u003eIf the king is in check, examine the next move of the king. List all those possible moves by which king can avoid the check by the next move.\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\u003eOtherwise 'checkmate'.\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\u003er = king's location\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\u003ep = position of opponent's pieces\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\u003eif the king is currently not in check, then he doesn't need to move. so return empty.\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\u003efor simplicity, assume that the king cannot take out opponent's pieces.\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":96,"title":"Knight's Tour Checker","description":"Given a matrix a, determine whether or not a legal \u003chttp://en.wikipedia.org/wiki/Knight's_tour knight's tour\u003e is present. The knight's tour always follows the pattern 1, 2, 3, ... but it need not fill the entire matrix. Any unused squares contain zeros. Your function should return true if the counting sequence from 1 to n represents a knight's tour, and false if not.\r\n\r\nExample\r\n\r\nThe matrix a as given below is a legal knight's tour. The middle square is unreachable, but since it contains a zero, it satisfies the condition. The function should return TRUE.\r\n\r\n  7     2     5\r\n  4     0     8\r\n  1     6     3\r\n\r\nHere is another legal (if short) knight's tour. The test suite will always contain at least one move (i.e. the counting sequence [1 2]). Note the matrix is not required to be square.\r\n\r\n  1     0     0\r\n  0     0     2\r\n \r\nHere is an illegal knight's tour. Everything is fine up until the jump from 14 to 15, which is illegal because it jumps from row 4 to row 1.\r\n\r\n 15     5    12     3\r\n  0     2     9     6\r\n  8    11     4    13\r\n  1    14     7    10","description_html":"\u003cp\u003eGiven a matrix a, determine whether or not a legal \u003ca href=\"http://en.wikipedia.org/wiki/Knight's_tour\"\u003eknight's tour\u003c/a\u003e is present. The knight's tour always follows the pattern 1, 2, 3, ... but it need not fill the entire matrix. Any unused squares contain zeros. Your function should return true if the counting sequence from 1 to n represents a knight's tour, and false if not.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003eThe matrix a as given below is a legal knight's tour. The middle square is unreachable, but since it contains a zero, it satisfies the condition. The function should return TRUE.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e7     2     5\r\n4     0     8\r\n1     6     3\r\n\u003c/pre\u003e\u003cp\u003eHere is another legal (if short) knight's tour. The test suite will always contain at least one move (i.e. the counting sequence [1 2]). Note the matrix is not required to be square.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1     0     0\r\n0     0     2\r\n\u003c/pre\u003e\u003cp\u003eHere is an illegal knight's tour. Everything is fine up until the jump from 14 to 15, which is illegal because it jumps from row 4 to row 1.\u003c/p\u003e\u003cpre\u003e 15     5    12     3\r\n  0     2     9     6\r\n  8    11     4    13\r\n  1    14     7    10\u003c/pre\u003e","function_template":"function tf = knights_tour(a)\r\n  tf = true;\r\nend","test_suite":"%%\r\n\r\na = ...\r\n[ 7     2     5\r\n  4     0     8\r\n  1     6     3];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = ...\r\n[ 1     0   0\r\n  0     0   2];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = ...\r\n[ 15     5    12     3\r\n   0     2     9     6\r\n   8    11     4    13\r\n   1    14     7    10];\r\ntf_correct = false;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = ...\r\n[  0     5    12     3\r\n  15     2     9     6\r\n   8    11     4    13\r\n   1    14     7    10];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = [22 29 4 31 16 35;3 32 23 34 5 14;28 21 30 15 36 17;9 2 33 24 13 6;20 27 8 11 18 25;1 10 19 26 7 12];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = [22 29 4 31 16 35;3 32 23 34 5 14;28 21 30 15 0 17;2 9 33 24 13 6;20 27 8 11 18 25;1 10 19 26 7 12];\r\ntf_correct = false;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0 0;0 0 0;2 0 0];\r\ntf_correct = false;\r\nassert(isequal(knights_tour(a),tf_correct))","published":true,"deleted":false,"likes_count":24,"comments_count":4,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1472,"test_suite_updated_at":"2016-01-13T18:56:25.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:30.000Z","updated_at":"2026-04-05T02:15:43.000Z","published_at":"2012-01-18T01:00:30.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 matrix a, determine whether or not a legal\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/Knight's_tour\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eknight's tour\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is present. The knight's tour always follows the pattern 1, 2, 3, ... but it need not fill the entire matrix. Any unused squares contain zeros. Your function should return true if the counting sequence from 1 to n represents a knight's tour, and false if 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\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\u003eThe matrix a as given below is a legal knight's tour. The middle square is unreachable, but since it contains a zero, it satisfies the condition. The function should return TRUE.\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[7     2     5\\n4     0     8\\n1     6     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\u003eHere is another legal (if short) knight's tour. The test suite will always contain at least one move (i.e. the counting sequence [1 2]). Note the matrix is not required to be square.\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[1     0     0\\n0     0     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\u003eHere is an illegal knight's tour. Everything is fine up until the jump from 14 to 15, which is illegal because it jumps from row 4 to row 1.\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[ 15     5    12     3\\n  0     2     9     6\\n  8    11     4    13\\n  1    14     7    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\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":54770,"title":"Count the peaceful queens","description":"In a 5x5 chessboard with a queen of one color (white, say) on the perimeter, one can place 12 black queens on the board such that none of the black queens can attack the white one (or vice versa). \r\nWrite a function that returns the number of queens that cannot attack a queen of the other color placed anywhere on the perimeter of an x chessboard.  \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: 328.7px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 164.35px; transform-origin: 407px 164.35px; 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: 85.1833px 8px; transform-origin: 85.1833px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn a 5x5 chessboard with a \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://en.wikipedia.org/wiki/Queen_(chess)#Placement_and_movement\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003equeen\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 272.283px 8px; transform-origin: 272.283px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e of one color (white, say) on the perimeter, one can place 12 black queens on the board such that none of the black queens can attack the white one (or vice versa). \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; 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: 372.883px 8px; transform-origin: 372.883px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function that returns the number of queens that cannot attack a queen of the other color placed anywhere on the perimeter of an \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, 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: 3.5px 8px; transform-origin: 3.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ex\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"font-family: \u0026quot;STIXGeneral\u0026quot;, \u0026quot;STIXGeneral-webfont\u0026quot;, 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: 42.0083px 8px; transform-origin: 42.0083px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e chessboard. \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\u003c/div\u003e\u003cdiv style=\"block-size: 226.7px; 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 113.35px; text-align: left; transform-origin: 384px 113.35px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline;width: 764px;height: 221px\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/oAAAEmCAYAAADShevcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAElsSURBVHhe7d0LsBX1lfj7tUEYEBUIRomJBiT4mEQ0I17FGyOjUbRUokVEM1JGjQOTKTS5EYwa1NIx6qhUMo4mgRA1FhMjSmVixWJQ4x/LvIwwMSQzIlz0CIkP4gNElIviub1Or1M0v9177+69+/Tjx/dTteus3gczfX6ze+3f+j26a90BAQAAAAAAXuhnPwEAAAAAgAco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ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003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = peacefulQueens(n)\r\n  y = f(n);\r\nend","test_suite":"%%\r\nn = 5;\r\nassert(isequal(peacefulQueens(n),12))\r\n\r\n%%\r\nn = 8;\r\nassert(isequal(peacefulQueens(n),42))\r\n\r\n%%\r\nn = 64;\r\nassert(isequal(peacefulQueens(n),3906))\r\n\r\n%%\r\nn = 4096;\r\nassert(isequal(peacefulQueens(n),16764930))\r\n\r\n%%\r\nn = 262144;\r\nassert(isequal(peacefulQueens(n),68718690306))\r\n\r\n%%\r\nn = 2097152;\r\nassert(isequal(peacefulQueens(n),4398040219650))\r\n\r\n%%\r\nn = 16777216;\r\nassert(isequal(peacefulQueens(n),281474926379010))\r\n\r\n%%\r\nm = randi(1000)+4;\r\ny = sum(arrayfun(@peacefulQueens,3:m));\r\nassert(isequal(y,polyval([1 3 2 0],m-2)/3))\r\n\r\n%%\r\nfiletext = fileread('peacefulQueens.m');\r\nillegal = contains(filetext, 'assignin') || contains(filetext, 'assert') || contains(filetext,'switch') || contains(filetext,'regexp'); \r\nassert(~illegal)\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":46909,"edited_by":46909,"edited_at":"2022-07-02T17:52:57.000Z","deleted_by":null,"deleted_at":null,"solvers_count":76,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2022-07-02T02:16:14.000Z","updated_at":"2026-01-26T15:48:57.000Z","published_at":"2022-07-02T02:17:02.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\u003eIn a 5x5 chessboard with a \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Queen_(chess)#Placement_and_movement\\\"\u003e\u003cw:r\u003e\u003cw:t\u003equeen\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e of one color (white, say) on the perimeter, one can place 12 black queens on the board such that none of the black queens can attack the white one (or vice versa). \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\u003eWrite a function that returns the number of queens that cannot attack a queen of the other color placed anywhere on the perimeter of an \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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\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\u003ex\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\u003cw:attr w:name=\\\"altTextString\\\" w:val=\\\"n\\\"/\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 chessboard. \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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"221\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"764\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA/oAAAEmCAYAAADShevcAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAElsSURBVHhe7d0LsBX1lfj7tUEYEBUIRomJBiT4mEQ0I17FGyOjUbRUokVEM1JGjQOTKTS5EYwa1NIx6qhUMo4mgRA1FhMjSmVixWJQ4x/LvIwwMSQzIlz0CIkP4gNElIviub1Or1M0v9177+69+/Tjx/dTteus3gczfX6ze+3f+j26a90BAQAAAAAAXuhnPwEAAAAAgAco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADAIxT6AAAAAAB4hEIfAAAAAACPUOgDAAAAAOARCn0AAAAAADxCoQ8AAAAAgEco9AEAAAAA8AiFPgAAAAAAHqHQBwAAAADA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ElFTkSuQmCC\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":45427,"title":"King's Cage","description":"Given the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Chess#Movement\u003e\r\n\r\nFor simplicity, numerical notation is used to represent the positions.","description_html":"\u003cp\u003eGiven the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Chess#Movement\"\u003ehttps://en.wikipedia.org/wiki/Chess#Movement\u003c/a\u003e\u003c/p\u003e\u003cp\u003eFor simplicity, numerical notation is used to represent the positions.\u003c/p\u003e","function_template":"function i = king(x,y)","test_suite":"%%\r\nx=[1,1];\r\ny=[5,5];\r\nassert(isequal( king(x,y),4))\r\n\r\n%%\r\nx=[6,6];\r\ny=[2,3];\r\nassert(isequal( king(x,y),4))\r\n\r\n%%\r\nx=[5,1];\r\ny=[5,5];\r\nassert(isequal( king(x,y),4))\r\n\r\n%%\r\nx=[2,3];\r\ny=[8,8];\r\nassert(isequal( king(x,y),6))\r\n\r\n%%\r\nx=[2,8];\r\ny=[7,1];\r\nassert(isequal( king(x,y),7))\r\n\r\n%%\r\nx=[1,4];\r\ny=[8,3];\r\nassert(isequal( king(x,y),7))\r\n\r\n\r\n%%\r\nx=[5,8];\r\ny=[5,8];\r\nassert(isequal( king(x,y),0))\r\n\r\n\r\n%%\r\nx=[1,4];\r\ny=[3,4];\r\nassert(isequal( king(x,y),2))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":363598,"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":"2020-04-07T06:55:52.000Z","updated_at":"2026-04-12T10:12:31.000Z","published_at":"2020-04-07T06:55:52.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 the position of the king on the chessboard, determine the minimum number of steps it'll require to reach the destination.\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/Chess#Movement\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Chess#Movement\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\u003eFor simplicity, numerical notation is used to represent the positions.\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":45240,"title":"Can the knight take out the pawn?","description":"* position of knight = k\r\n* position of pawns  = p\r\n\r\ncan the knight take out those pawns?\r\n\r\n* k='Nf4'\r\n* p={'g6','g7'}\r\n\r\nthen output should be [1,0]\r\n\r\n","description_html":"\u003cul\u003e\u003cli\u003eposition of knight = k\u003c/li\u003e\u003cli\u003eposition of pawns  = p\u003c/li\u003e\u003c/ul\u003e\u003cp\u003ecan the knight take out those pawns?\u003c/p\u003e\u003cul\u003e\u003cli\u003ek='Nf4'\u003c/li\u003e\u003cli\u003ep={'g6','g7'}\u003c/li\u003e\u003c/ul\u003e\u003cp\u003ethen output should be [1,0]\u003c/p\u003e","function_template":"function y = knight_move(k,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nk = 'Nd5';\r\np={'c3','c4','d3','e3','f4','f5','f6','g2','a5'}\r\ny_correct =  [1     0     0     1     1     0     1     0     0];\r\nassert(isequal(knight_move(k,p),y_correct))\r\n\r\n%%\r\nk = 'Ne3';\r\np={'c3','c4','d3','f4','f5','f6','g2','a5'}\r\ny_correct =  [0     1     0      0     1     0     1     0];\r\nassert(isequal(knight_move(k,p),y_correct))\r\n\r\n%%\r\nk = 'Na8';\r\np={'c3','a7','a6','b6','c6','b2','f6'}\r\ny_correct = [ 0     0     0     1     0     0     0];\r\nassert(isequal(knight_move(k,p),y_correct))\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":14,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-21T22:12:27.000Z","updated_at":"2026-01-23T13:26:38.000Z","published_at":"2019-12-21T22:18: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\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eposition of knight = k\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\u003eposition of pawns = p\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\u003ecan the knight take out those pawns?\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\u003ek='Nf4'\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\u003ep={'g6','g7'}\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 output should be [1,0]\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":45329,"title":"Castling-01","description":"Given the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Castling\u003e","description_html":"\u003cp\u003eGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Castling\"\u003ehttps://en.wikipedia.org/wiki/Castling\u003c/a\u003e\u003c/p\u003e","function_template":"function y = castling_01(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na={'Ra1','Ka7'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rh1'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rh1','Kh8'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rc1','Kh5'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra1','Rh1','Ke1'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Ra1','Rh1','Ke1'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rh1','Ke1'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rh5','Ke5'}\r\nassert(isequal(castling_01(a),0))\r\n%%\r\na={'Ra8','Ke8'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rd8','Rh8','Ke8'}\r\nassert(isequal(castling_01(a),1))\r\n%%\r\na={'Rh8','Kd8'}\r\nassert(isequal(castling_01(a),0))","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":16,"test_suite_updated_at":"2020-02-15T23:25:16.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-15T12:59:18.000Z","updated_at":"2026-01-23T13:34:49.000Z","published_at":"2020-02-15T23:08: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\u003eGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or 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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Castling\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Castling\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\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":45336,"title":"chess position","description":"given the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For example,\r\n\r\n* 'Qd5' \u003e\u003e [3,4]\r\n\r\nNb. invalid ones should be represented by nan.\r\n","description_html":"\u003cp\u003egiven the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For example,\u003c/p\u003e\u003cul\u003e\u003cli\u003e'Qd5' \u0026gt;\u0026gt; [3,4]\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eNb. invalid ones should be represented by nan.\u003c/p\u003e","function_template":"function a = chess_pos(pos)\r\n  y = x;\r\nend","test_suite":"%%\r\npos={'Qe5','Rb2'}\r\na=[4,1;4,1]\r\nassert(isequal(chess_pos(pos),a))\r\n\r\n%%\r\npos={'a5','Nb8'}\r\na=[0,1;4,7]\r\nassert(isequal(chess_pos(pos),a))\r\n\r\n%%\r\npos={'Ng8'}\r\na=[6;7]\r\nassert(isequal(chess_pos(pos),a))\r\n\r\n%%\r\npos={'f1','Qb1','Bd9','c3','Rg7'}\r\na=[  5     1   NaN     2     6;\r\n     0     0   NaN     2     6]\r\nassert(isequaln(chess_pos(pos),a))\r\n\r\n%%\r\npos={'k1','Kc3','Rh9'}\r\na= [NaN     2   NaN\r\n   NaN     2   NaN]\r\nassert(isequaln(chess_pos(pos),a))","published":true,"deleted":false,"likes_count":0,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":16,"test_suite_updated_at":"2020-02-17T05:55:18.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-16T23:12:04.000Z","updated_at":"2026-01-23T14:06:55.000Z","published_at":"2020-02-17T05:55: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 the position of a chess piece in algebric notation, convert it into 8 by 8 matrix format. For 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\u003e'Qd5' \u0026gt;\u0026gt; [3,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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eNb. invalid ones should be represented by nan.\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":3057,"title":"Chess performance","description":"After Problems \u003chttp://www.mathworks.com/matlabcentral/cody/problems/3054-chess-elo-rating-system/ 3054\u003e and \u003chttp://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/ 3056\u003e\r\n\r\n\r\nIn \u003chttp://en.wikipedia.org/wiki/Elo_rating_system Chess\u003e, performance isn't measured absolutely; it is inferred from wins (1), losses (0), and draws (0.5) against other players. A player's rating depends on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them.\r\n\r\nSupposing Player A was expected to score Ea points (but actually scored Sa).\r\n\r\nThe formula for updating his rating is :\r\n\r\n\u003c\u003chttp://upload.wikimedia.org/math/2/3/f/23fbcb658ac1e2565003c2190f28a21e.png\u003e\u003e\r\n\r\n* \r\n* \r\n\r\n\r\nThis update can be performed after each game or each tournament, or after any suitable rating period. \r\n\r\nSuppose Player A has a rating *Ra* of 1613, and plays in a five-round tournament. He (or she) loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score *Sa* is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score *Ea* , calculated according to the formula see in Problem 3056, was (0.506 + 0.686 + 0.785 + 0.539 + 0.351) = 2.867. Therefore the player's new rating *R'a* is (1613 + 32×(2.5 − 2.867)) = 1601. We assume that the *K* factor is always 32.\r\n\r\nI give you rating of Player A, ratings of their opponents and results. \r\n\r\nCompute the new rating (K = 32).\r\n\r\n\r\n","description_html":"\u003cp\u003eAfter Problems \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/3054-chess-elo-rating-system/\"\u003e3054\u003c/a\u003e and \u003ca href = \"http://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/\"\u003e3056\u003c/a\u003e\u003c/p\u003e\u003cp\u003eIn \u003ca href = \"http://en.wikipedia.org/wiki/Elo_rating_system\"\u003eChess\u003c/a\u003e, performance isn't measured absolutely; it is inferred from wins (1), losses (0), and draws (0.5) against other players. A player's rating depends on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them.\u003c/p\u003e\u003cp\u003eSupposing Player A was expected to score Ea points (but actually scored Sa).\u003c/p\u003e\u003cp\u003eThe formula for updating his rating is :\u003c/p\u003e\u003cimg src = \"http://upload.wikimedia.org/math/2/3/f/23fbcb658ac1e2565003c2190f28a21e.png\"\u003e\u003cul\u003e\u003cli\u003e\u003c/li\u003e\u003cli\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eThis update can be performed after each game or each tournament, or after any suitable rating period.\u003c/p\u003e\u003cp\u003eSuppose Player A has a rating \u003cb\u003eRa\u003c/b\u003e of 1613, and plays in a five-round tournament. He (or she) loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score \u003cb\u003eSa\u003c/b\u003e is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score \u003cb\u003eEa\u003c/b\u003e , calculated according to the formula see in Problem 3056, was (0.506 + 0.686 + 0.785 + 0.539 + 0.351) = 2.867. Therefore the player's new rating \u003cb\u003eR'a\u003c/b\u003e is (1613 + 32×(2.5 − 2.867)) = 1601. We assume that the \u003cb\u003eK\u003c/b\u003e factor is always 32.\u003c/p\u003e\u003cp\u003eI give you rating of Player A, ratings of their opponents and results.\u003c/p\u003e\u003cp\u003eCompute the new rating (K = 32).\u003c/p\u003e","function_template":"function y = new_elo(opponents_elo,res,elo_playerA)\r\n  y = x;\r\nend","test_suite":"%%\r\nplayera=1613;\r\nelos=[1609 1477 1388 1586 1720];\r\nres=[0 0.5 1 1 0];\r\nassert(isequal(new_elo(elos,res,playera),1601))\r\n%%\r\nplayera=1613;\r\nelos=[1609 1477 1586 1720];\r\nres=[0 1 1 1];\r\nassert(isequal(new_elo(elos,res,playera),1642))\r\n%%\r\nplayera=1613;\r\nelos=[1613 1613 1613 1613 1613];\r\nres=[0.5 0.5 0.5 0.5 0.5];\r\nassert(isequal(new_elo(elos,res,playera),1613))\r\n%%\r\nassert(isequal(new_elo([1800 1900 2000 2100 2200],[1 0 1 0 1],1900),1935))\r\n%% My new ELO\r\nplayera=1800;\r\nelos=[1399 1280 2166 1534 1768 1791 1540];\r\nres=[1 1 0 1 1 0 1];\r\nassert(isequal(new_elo(elos,res,playera),1811))\r\n%% The last game was critical (-32 points if I lost)\r\nplayera=1800;\r\nelos=[1399 1280 2166 1534 1768 1791 1540];\r\nres=[1 1 0 1 1 0 0];\r\nassert(isequal(new_elo(elos,res,playera),1779))\r\n%% Perfect tournament ?\r\nplayera=1800;\r\nelos=[1399 1280 2166 1534 1768 1791 1540];\r\nres=[1 1 1 1 1 1 1];\r\nassert(isequal(new_elo(elos,res,playera),1875))\r\n%% Caruana in 2014 Sinquefield Cup (notice that K=16 for these guys)\r\ncaruana=2801;\r\nelos = [2772 2768 2877 2805 2787  2772 2768 2877 2787 2805];\r\nres = [1 1 1 1 1 1 1 0.5 0.5 0.5];\r\nassert(isequal(new_elo(elos,res,caruana),2913))","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":65,"test_suite_updated_at":"2015-03-02T20:49:24.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2015-02-28T23:49:25.000Z","updated_at":"2026-02-15T07:24:43.000Z","published_at":"2015-02-28T23:53: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\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"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\u003eAfter Problems\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/3054-chess-elo-rating-system/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e3054\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=\\\"http://www.mathworks.com/matlabcentral/cody/problems/3056-chess-probability/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e3056\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\u003eIn\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/Elo_rating_system\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eChess\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e, performance isn't measured absolutely; it is inferred from wins (1), losses (0), and draws (0.5) against other players. A player's rating depends on the ratings of their opponents, and the results scored against them. The difference in rating between two players determines an estimate for the expected score between them.\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\u003eSupposing Player A was expected to score Ea points (but actually scored Sa).\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 formula for updating his rating is :\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:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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\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\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 update can be performed after each game or each tournament, or after any suitable rating period.\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 Player A has a rating\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\u003eRa\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e of 1613, and plays in a five-round tournament. He (or she) loses to a player rated 1609, draws with a player rated 1477, defeats a player rated 1388, defeats a player rated 1586, and loses to a player rated 1720. The player's actual score\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\u003eSa\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is (0 + 0.5 + 1 + 1 + 0) = 2.5. The expected score\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\u003eEa\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e , calculated according to the formula see in Problem 3056, was (0.506 + 0.686 + 0.785 + 0.539 + 0.351) = 2.867. Therefore the player's new rating\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\u003eR'a\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e is (1613 + 32×(2.5 − 2.867)) = 1601. We assume that the\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\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e factor is always 32.\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\u003eI give you rating of Player A, ratings of their opponents and results.\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\u003eCompute the new rating (K = 32).\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\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANYAAAAWBAMAAABOJX+pA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3ghHJTtUZJZN5pYcFjK1irPdGfdxUPRgHqxJG+fBIVYseK4wBOLWKcZIt8l5Gyc10PlROFTa8ktiAWjauJCfDpu3wxjduirod4y5sVWJ3xFooKiDaTJs22/vnYHvW9g8gtvNvC0XkMLGLXXkAAAAASUVORK5CYII=\"}]}"},{"id":45330,"title":"Castling-02","description":"This is a follow up of problem \r\n\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\u003e\r\n\r\n\r\nGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Castling\u003e","description_html":"\u003cp\u003eThis is a follow up of problem\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\"\u003ehttps://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\u003c/a\u003e\u003c/p\u003e\u003cp\u003eGiven the position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or not.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Castling\"\u003ehttps://en.wikipedia.org/wiki/Castling\u003c/a\u003e\u003c/p\u003e","function_template":"function tf=castling_02(a)\r\n  y = x;\r\nend","test_suite":"%%\r\na={'Rd1','Rh1','Ke1'}\r\nassert(isequal(castling_02(a),1))\r\n%%\r\na={'Rd1','Rd4','Ke1','Bb6'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'d1','Rh8','Kg1'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'Ra1','Rh1','Ke1','Qd1'}\r\nassert(isequal(castling_02(a),1))\r\n%%\r\na={'Ra1','Rh1','Ke1','Qd1','Bg1'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'Ba2','Ra1','Rb1','Ke1','Bg1'}\r\nassert(isequal(castling_02(a),0))\r\n%%\r\na={'Na1','Rh1','Ke1','Qd1'}\r\nassert(isequal(castling_02(a),1))\r\n%%\r\na={'Kd1','Qe1','Rh1','Rd8','a4','Nf2'}\r\nassert(isequal(castling_02(a),0))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-15T23:34:53.000Z","updated_at":"2026-01-23T13:53:26.000Z","published_at":"2020-02-15T23:38: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\u003eThis is a follow up of problem\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://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/groups/1/problems/45329-castling-01\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 position of only one player's chess pieces(some of them) on the chessboard, figure out whether castling is valid or 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\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"https://en.wikipedia.org/wiki/Castling\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Castling\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\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":45236,"title":"Queen's move","description":"given a number of consecutive moves of queen, check for their validity based on their previous position....\r\nbut remember if u get an invalid move - u need check for the next move's validity based on the last valid position.....\r\n\r\n* x={'Qd1','Qd5','Qf7','Qa8','Qg8'}\r\n* y=[1,1,1,0,1]\r\n \r\n\u003chttps://en.wikipedia.org/wiki/Algebraic_notation_(chess)\u003e\r\n","description_html":"\u003cp\u003egiven a number of consecutive moves of queen, check for their validity based on their previous position....\r\nbut remember if u get an invalid move - u need check for the next move's validity based on the last valid position.....\u003c/p\u003e\u003cul\u003e\u003cli\u003ex={'Qd1','Qd5','Qf7','Qa8','Qg8'}\u003c/li\u003e\u003cli\u003ey=[1,1,1,0,1]\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Algebraic_notation_(chess)\"\u003ehttps://en.wikipedia.org/wiki/Algebraic_notation_(chess)\u003c/a\u003e\u003c/p\u003e","function_template":"function y = Queen_move(x)","test_suite":"%%\r\nx = {'Qd1','Qd5','Qf7','Qa8','Qg8'};\r\ny_correct = [1,1,1,0,1];\r\nassert(isequal(Queen_move(x),y_correct))\r\n%%\r\nx = {'Qd1','Qd5','Qf7','Qa8','Qc7'};\r\ny_correct = [1,1,1,0,1];\r\nassert(isequal(Queen_move(x),y_correct))\r\n%%\r\nx={'Qh1','Qg5','Qe6','Qe2','Qb3','Qd5','Qh7'};\r\ny_correct = [1,0,0,0,0,1,0];\r\nassert(isequal(Queen_move(x),y_correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-20T16:33:40.000Z","updated_at":"2026-01-23T12:20:52.000Z","published_at":"2019-12-20T16:35: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\u003egiven a number of consecutive moves of queen, check for their validity based on their previous position.... but remember if u get an invalid move - u need check for the next move's validity based on the last valid position.....\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\u003ex={'Qd1','Qd5','Qf7','Qa8','Qg8'}\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\u003ey=[1,1,1,0,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/Algebraic_notation_(chess)\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Algebraic_notation_(chess\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\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":315,"title":"Valid Chess Moves","description":"Using standard Algebraic notation ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:\r\nMoving a pawn one space:\r\n('c5','c6') -\u003e true \r\n\r\nMoving a bishop non-diagonally:\r\n('Bb7','Bd7') -\u003e false","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: 175.167px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 87.5833px; transform-origin: 407px 87.5833px; 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: 384px 31.5px; text-align: left; transform-origin: 384px 31.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: 17.5px 8px; transform-origin: 17.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eUsing\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003estandard Algebraic notation\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 276.5px 8px; transform-origin: 276.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 102.167px; 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 51.0833px; transform-origin: 404px 51.0833px; 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: 96px 8.5px; tab-size: 4; transform-origin: 96px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 8.5px; \"\u003eMoving \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 68px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 68px 8.5px; \"\u003ea pawn one space:\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: 80px 8.5px; tab-size: 4; transform-origin: 80px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e(\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 16px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 16px 8.5px; \"\u003e'c5'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e,\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 16px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 16px 8.5px; \"\u003e'c6'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e) -\u0026gt; true \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; tab-size: 4; 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: 124px 8.5px; tab-size: 4; transform-origin: 124px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 28px 8.5px; transform-origin: 28px 8.5px; \"\u003eMoving \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 96px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 96px 8.5px; \"\u003ea bishop non-diagonally:\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e(\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 20px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 20px 8.5px; \"\u003e'Bb7'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 4px 8.5px; transform-origin: 4px 8.5px; \"\u003e,\u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(170, 4, 249); border-block-start-color: rgb(170, 4, 249); border-bottom-color: rgb(170, 4, 249); border-inline-end-color: rgb(170, 4, 249); border-inline-start-color: rgb(170, 4, 249); border-left-color: rgb(170, 4, 249); border-right-color: rgb(170, 4, 249); border-top-color: rgb(170, 4, 249); caret-color: rgb(170, 4, 249); color: rgb(170, 4, 249); column-rule-color: rgb(170, 4, 249); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(170, 4, 249); perspective-origin: 20px 8.5px; text-decoration-color: rgb(170, 4, 249); text-emphasis-color: rgb(170, 4, 249); transform-origin: 20px 8.5px; \"\u003e'Bd7'\u003c/span\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 40px 8.5px; transform-origin: 40px 8.5px; \"\u003e) -\u0026gt; false\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function z = chessmove(x,y)\r\n  z = false;\r\nend","test_suite":"%%\r\nx = 'c5';\r\ny = 'c6';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'a2';\r\ny = 'a5';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'g3';\r\ny = 'h4';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Bb7';\r\ny = 'Bd7';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Bg2';\r\ny = 'Bh3';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Nf1';\r\ny = 'Ne3';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Nc5';\r\ny = 'Nc3';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Qb2';\r\ny = 'Qc4';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Qa1';\r\ny = 'Qh8';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Rh7';\r\ny = 'Rh3';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Rb2';\r\ny = 'Rh8';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Ke1';\r\ny = 'Ke2';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Kf3';\r\ny = 'Kg4';\r\nz = true;\r\nassert(isequal(chessmove(x,y),z))\r\n\r\n%%\r\nx = 'Kb2';\r\ny = 'Kc4';\r\nz = false;\r\nassert(isequal(chessmove(x,y),z))","published":true,"deleted":false,"likes_count":2,"comments_count":2,"created_by":1022,"edited_by":223089,"edited_at":"2022-05-23T10:24:16.000Z","deleted_by":null,"deleted_at":null,"solvers_count":85,"test_suite_updated_at":"2022-05-23T09:39:10.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-13T05:34:29.000Z","updated_at":"2026-03-30T18:59:55.000Z","published_at":"2012-02-13T05:35:32.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\u003eUsing\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003estandard Algebraic notation\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e ('' for a pawn), given previous move and a next move, output true if it is a valid move or false otherwise. Assume there are no other pieces on the chess board, that the piece can be either black or white (whichever generates a valid result) and the previous move was valid. Examples:\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[Moving a pawn one space:\\n('c5','c6') -\u003e true \\n\\nMoving a bishop non-diagonally:\\n('Bb7','Bd7') -\u003e false]]\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":45433,"title":"The Dark Knight","description":"  The current position of the knight is x \r\n  The desired destination is y\r\n The size of the chessboard is n.\r\n\r\nFind the minimum number of moves required by the knight to reach the destination.\r\n\r\nFor example, \r\n  \r\n x=[2,2]  y=[3,3] -- moves required = 2  \r\n   [2,2] \u003e [1,4] \u003e [3,3]\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003eThe current position of the knight is x \r\nThe desired destination is y\r\nThe size of the chessboard is n.\r\n\u003c/pre\u003e\u003cp\u003eFind the minimum number of moves required by the knight to reach the destination.\u003c/p\u003e\u003cp\u003eFor example,\u003c/p\u003e\u003cpre\u003e x=[2,2]  y=[3,3] -- moves required = 2  \r\n   [2,2] \u0026gt; [1,4] \u0026gt; [3,3]\u003c/pre\u003e","function_template":"function out = knight_step(x,y,n)","test_suite":"%%\r\nassert(isequal(knight_step([2,2],[3,3],8),2))\r\n%%\r\nassert(isequal(knight_step([2,2],[1,1],20),4))\r\n\r\n%%\r\nassert(isequal(knight_step([2,2],[8,8],12),4))\r\n\r\n%%\r\nassert(isequal(knight_step([2,2],[12,11],12),7))\r\n\r\n%%\r\nassert(isequal(knight_step([1,3],[8,3],8),5))\r\n%%\r\nassert(isequal(knight_step([1,3],[5,4],8),3))\r\n%%\r\nassert(isequal(knight_step([8,2],[1,2],8),5))\r\n\r\n%%\r\nassert(isequal(knight_step([8,7],[21,32],50),14))\r\n%%\r\nassert(isequal(knight_step([5,19],[5,19],20),0))\r\n%%\r\nassert(isequal(knight_step([5,19],[19,5],20),10))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":0,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":21,"test_suite_updated_at":"2020-04-10T06:28:31.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-10T06:20:09.000Z","updated_at":"2026-01-21T12:55:02.000Z","published_at":"2020-04-10T06:28:31.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[The current position of the knight is x \\nThe desired destination is y\\nThe size of the chessboard is n.]]\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\u003eFind the minimum number of moves required by the knight to reach the destination.\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=[2,2]  y=[3,3] -- moves required = 2  \\n   [2,2] \u003e [1,4] \u003e [3,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":45238,"title":"Checkmate","description":"* The positions of different chess pieces are given in a cell  *p* . \r\n* The position of the king is given as *x*\r\n\r\nDetermine if the opponent king is in check for individual scenerios.\r\n\r\n* x='Kg7'\r\n* p={'Qe5','Qg5','Qb5','Qa7'}\r\n\r\noutput= [1,1,0,1]\r\n\r\nN.b.any invalid position should produce 0.\r\nu may imagine p as the white pieces and x as the black king for clarity.","description_html":"\u003cul\u003e\u003cli\u003eThe positions of different chess pieces are given in a cell  \u003cb\u003ep\u003c/b\u003e .\u003c/li\u003e\u003cli\u003eThe position of the king is given as \u003cb\u003ex\u003c/b\u003e\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eDetermine if the opponent king is in check for individual scenerios.\u003c/p\u003e\u003cul\u003e\u003cli\u003ex='Kg7'\u003c/li\u003e\u003cli\u003ep={'Qe5','Qg5','Qb5','Qa7'}\u003c/li\u003e\u003c/ul\u003e\u003cp\u003eoutput= [1,1,0,1]\u003c/p\u003e\u003cp\u003eN.b.any invalid position should produce 0.\r\nu may imagine p as the white pieces and x as the black king for clarity.\u003c/p\u003e","function_template":"function y=checkmate(x,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nx='Kg7';\r\np={'Qe5','Qg5','Qb5','Qa7'}\r\ny_correct = [1,1,0,1];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Kg7';\r\np={'Qe5','Rg5','Bb5','Na7','h6'}\r\ny_correct = [1,1,0,0,1];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Ka3';\r\np={'Qe5','Rg5','Bb5','Na7','h6'}\r\ny_correct = [0,0,0,0,0];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Ka3';\r\np={'a2','Rg5','Be7','Nc4','Nb1'}\r\ny_correct = [0,0,1,1,1];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Ka3';\r\np={'a2','Rg5','Be7','Nc5','Kb2'}\r\ny_correct = [0,0,1,0,0];\r\nassert(isequal(checkmate(x,p),y_correct))\r\n\r\n%%\r\nx='Kf2';\r\np={'Ra2','Rg5','Bh4','Bg1','Nd3','Kf3','Ng1','e1','Qg4','Qf7'}\r\ny_correct = [1,0,1,1,1,0,0,0,0,1];\r\nassert(isequal(checkmate(x,p),y_correct))","published":true,"deleted":false,"likes_count":3,"comments_count":5,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-21T00:09:28.000Z","updated_at":"2026-01-23T12:59:27.000Z","published_at":"2019-12-21T00:12:53.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"ListParagraph\\\"/\u003e\u003cw:numPr\u003e\u003cw:numId w:val=\\\"1\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe positions of different chess pieces are given in a cell \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\u003ep\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=\\\"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 position of the king is given as\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\u003ex\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\u003eDetermine if the opponent king is in check for individual scenerios.\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\u003ex='Kg7'\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\u003ep={'Qe5','Qg5','Qb5','Qa7'}\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= [1,1,0,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\u003eN.b.any invalid position should produce 0. u may imagine p as the white pieces and x as the black king for clarity.\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":306,"title":"Eight Queens Solution Checker","description":"Write a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic eight queens problem.\r\nIn the eight queens problem, eight queens must be placed on a chessboard such that no two queens attack each other. That is, no two queens can share the same row, column, or diagonal. The diagram below is one possible solution:\r\n\r\nYour function should take an 8-by-8 matrix of 0s and 1s, where the 1s represent the position of the queens, and return a logical 1 if the solution is valid or a logical 0 otherwise.\r\nEXAMPLE 1\r\n   in1 = [ ...\r\n       0 0 0 1 0 0 0 0\r\n       0 0 0 0 0 0 1 0\r\n       0 0 1 0 0 0 0 0\r\n       0 0 0 0 0 0 0 1\r\n       0 1 0 0 0 0 0 0\r\n       0 0 0 0 1 0 0 0\r\n       1 0 0 0 0 0 0 0\r\n       0 0 0 0 0 1 0 0 ];\r\n\r\n   isEightQueensSolution(in1)\r\nreturns 1.\r\nEXAMPLE 2\r\n   in2 = [ ...\r\n       0 0 0 1 0 0 0 0\r\n       0 0 0 0 0 0 1 0\r\n       0 0 1 0 0 0 0 0\r\n       0 0 0 0 0 0 0 1\r\n       0 1 0 0 0 0 0 0\r\n       1 0 0 0 0 0 0 0\r\n       0 0 0 0 1 0 0 0\r\n       0 0 0 0 0 1 0 0 ];\r\n\r\n   isEightQueensSolution(in2)\r\nreturns 0. (Notice that the queens on the bottom two rows share a diagonal.)","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: 1032.03px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 516.017px; transform-origin: 407px 516.017px; 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: 343.5px 8px; transform-origin: 343.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eWrite a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"/#null\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eeight queens problem\u003c/span\u003e\u003c/span\u003e\u003c/a\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: 2px 8px; transform-origin: 2px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003e.\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; 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: 377.5px 8px; transform-origin: 377.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eIn the eight queens problem, eight queens must be placed on a chessboard such that no two queens attack each other. That is, no two queens can share the same row, column, or diagonal. The diagram below is one possible solution:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 287.5px; 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 143.75px; text-align: center; transform-origin: 384px 143.75px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cimg class=\"imageNode\" style=\"vertical-align: baseline\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARoAAAEaCAIAAABB0Q/tAAAXF0lEQVR42u2de2xVVdrGe6X0tKXtodRS6rHtqYci6MBQoZCGaYDwqcOIgwQQIVSFMioKgToIRjJgIChyB8XCAFViJhnjhcmIcdAQnBj+KF4y/uGFQWIMIpLSeKmkgHxPu5jFbu33TTzdhdOu385mZ593v2vlPH3XL2uvczj7iXuGjY3Npy1O/y5ebLwy+6C6Z6/MjiIUXXlF4IQiFIFTty3VwB2bw2tX6sjgAydK9QsUFa9efu3i+ZHt622kcMXS5H45cXFxOurcxiPPrCt4eJ7ywQmcKFUHe+6MKUkpKcFgMDm3X8m6VSYYGFy6cOHCr776Skedm6Amq6S+2cpUvlqBEzi5XqqBz23oP2dW/7mzzVxUumtrQiD1pZdeam5unjx5cva435i03oWhTZs2Xbx4UUedm6CuKkeZylcrtb3U4dzZ6lMn4ARODpWqdPe2wKCBxcXF4XC4V16u1kVCIj4l5Y033rhw4cLdd9+dVVlh3pUIyczKmjZtmo46N0FdVY4yla9WaqseUsNF6q2kpCQwsGRg7SZwAidXShVauqhfv35nzpw5d+5cXl6eVkEK5ky6LSUlRUgkZWUWr/mTfWN5VTO0dtLRu8RKTE9TpvLVShH1oHu/pqams2fPqmctwMAJnFwp1XXLFmdkZHz++efffPNNdnZ2wYI/mPdQ9MRjWjgFbx3vfWOhJQuEU8HC+71B5ShT+TZH/ai3r7/+Wj2rf3ACJ4dKpRs2QRIfHx8ojXg/BE+NhJNz+nojudMmK1NH70fnmp2U6X3/unuMb93Sf/0r1k7g5FypNLcIkpRQQemft3hxEjyhRx62kcyKUYr0GVlmI5rNFPHipB70Ur3Z+QqcwMm5Umn0C4z+985sh1PGiOE2knLtgJqaml55uaW7t5mIrrbDST0o4mUJnMDJuVJdv3VtXEJCYkZGZNvTFqfa2tqUQOD6TWvMfV18YuInn3ySkJBg7gAV11XlWJzUVj2oH/UGTuDkdKmS+mZrYrFfNAmSt956a8KECdfMnNryocXjj2RnZ1+8eLGgoEDniiiuq8qxOKmtelA/fI0LTq6Xqndx4cSJE9PS04tWLrM41dXVaU3VAs+saePHjxdOOuq85d4vVKCrFie1Ulv1oH7ACZxcL1XGzcNWrVq1bNmy1HCRVkcGp8bGxozMzMIVS7PHVz700EPCacmSJZkVoxRRXFcNTi354aIFCxZs2LBB/YATOLleqn5TJs2cOfO7777Lycnpf+/M1JJiofLTTz/dd999WZUVmot2796tl3v27OmVl6uI4nrZglNJsfLVSm3nzZunfsAJnFwvVf68e8rKyjT/PP/883Gt2/79+48cObJmzRrzcvbs2XPnzq2pqTEvX3zxxc8++0w4mZdqpbZjxoxRP+AETq6X6rpli3v37v3jjz9qzhk+fLj5bjeu7Zafn2/PzdXi4mIdlf9T69avXz/vV1XgBE6OliryzDqBoQlq9erVo0ePNvC88sor69evv/322++66y5NR+fOndu4ceOwYcMGDx68dOlSXe3bt68y58yZs2PHjttuu03n9qN2cAInd0s1cMfmhLRAOBy+s3V74oknTp06pQlHt3A//d/bp59+Wl1dXVpaOmjQILVVDz//uS41AicXSxW8ZdzIkSObm5vFSWNj47Fjx15r3TRBPd52U8RcUo4yla9Waqse+PkgOFGq1v8bseXJxMw+lZWVQ4cOTUtLCwQCupe78cYb/6ejTfDoqnKUqXy1Ulv1AE7gRKku7TmTf6f1z65duz788MMzZ87815s95Rw9enT37t3XXHON2vLjdnCiVJf3wuV/FE66c/vyyy/feeedLVu2bNiwYcWKFTPabvPnz9/Quh04cEDLp6amppSUFLUFJ3CiVJf30l1bhdOAAQ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uXlZVEbRaotpUIROF3az59vqKqaEQikRmEUmZSUOH36nR0unygVitx9qPLp08f27q1dtOjBCRPGDhkyKBjMzsrKbPd/YRVRvLAwpBxlKr/DL3ApFYp45H8Hs9bRo+97d/v0FUqFInDC3wlFKAInBh+KYhMn/oIoQlHnd3BCEYrAicEXM4pwdgUnFEWjCGdXcEKRP4pwdgUnFEWpCGdXcAInfxTh7ApO4OSbIpxdwQmcfFOEsys4gZOfinB2BSdw8lMRzq7gBE5+KsLZFZzAyTdFOLuCEzj5qQhnV3ACJ98U4ewKTuDkmyKcXcEJnHxThLMrOIGTb4pwdgUncPJNEc6u4AROvinC2RWcwMk3RTi7ghM4+akIZ1dwQpFvinB2BScU+akIZ1dwQpFvinB2BScU+aYIZ1dwQpHPOOHsCk4o8kERzq7ghCLfFOHsCk4o8k0Rzq7ghCJ/FOHsCk4o8lkRzq7ghKIuVISzKzihCEXgxOBDUXfBiY2NzZftfwHAyDu2GXeLKAAAAABJRU5ErkJggg==\" data-image-state=\"image-loaded\"\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; 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: 380px 8px; transform-origin: 380px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003eYour function should take an 8-by-8 matrix of 0s and 1s, where the 1s represent the position of the queens, and return a logical 1 if the solution is valid or a logical 0 otherwise.\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: 39px 8px; transform-origin: 39px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eEXAMPLE 1\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 224.767px; 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 112.383px; transform-origin: 404px 112.383px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 44px 8.5px; transform-origin: 44px 8.5px; \"\u003e   in1 = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); perspective-origin: 12px 8.5px; text-decoration: none; text-decoration-color: rgb(14, 0, 255); text-emphasis-color: rgb(14, 0, 255); transform-origin: 12px 8.5px; \"\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 1 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 1 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 1 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 0 1\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 1 0 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 1 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       1 0 0 0 0 0 0 0\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: 100px 8.5px; tab-size: 4; transform-origin: 100px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 1 0 0 ];\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; tab-size: 4; 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: 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; \"\u003e   isEightQueensSolution(in1)\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: 30.5px 8px; transform-origin: 30.5px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ereturns 1.\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: 39px 8px; transform-origin: 39px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"font-weight: 700; \"\u003eEXAMPLE 2\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 224.767px; 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 112.383px; transform-origin: 404px 112.383px; 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: 56px 8.5px; tab-size: 4; transform-origin: 56px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; perspective-origin: 44px 8.5px; transform-origin: 44px 8.5px; \"\u003e   in2 = [ \u003c/span\u003e\u003cspan style=\"border-block-end-color: rgb(14, 0, 255); border-block-start-color: rgb(14, 0, 255); border-bottom-color: rgb(14, 0, 255); border-inline-end-color: rgb(14, 0, 255); border-inline-start-color: rgb(14, 0, 255); border-left-color: rgb(14, 0, 255); border-right-color: rgb(14, 0, 255); border-top-color: rgb(14, 0, 255); caret-color: rgb(14, 0, 255); color: rgb(14, 0, 255); column-rule-color: rgb(14, 0, 255); margin-inline-end: 0px; margin-right: 0px; outline-color: rgb(14, 0, 255); perspective-origin: 12px 8.5px; text-decoration: none; text-decoration-color: rgb(14, 0, 255); text-emphasis-color: rgb(14, 0, 255); transform-origin: 12px 8.5px; \"\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 1 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 1 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 1 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 0 0 1\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 1 0 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       1 0 0 0 0 0 0 0\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: 88px 8.5px; tab-size: 4; transform-origin: 88px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 1 0 0 0\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: 100px 8.5px; tab-size: 4; transform-origin: 100px 8.5px; unicode-bidi: normal; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       0 0 0 0 0 1 0 0 ];\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; tab-size: 4; 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: 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; \"\u003e   isEightQueensSolution(in2)\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: 240px 8px; transform-origin: 240px 8px; unicode-bidi: normal; \"\u003e\u003cspan style=\"\"\u003ereturns 0. (Notice that the queens on the bottom two rows share a diagonal.)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function y = isEightQueensSolution(x)\r\n  y = x;\r\nend","test_suite":"%% Eight Queens Solution Checker Test Suite\r\n\r\n%%\r\n% Unique solution #6 from \r\n% http://en.wikipedia.org/wiki/Eight_queens_puzzle\r\nin1 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout1 = isEightQueensSolution(in1);\r\nassert(islogical(out1));\r\nassert(isequal(out1, 1));\r\n\r\n%%\r\n% Unique solution #7\r\nin2 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    0 0 0 1 0 0 0 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout2 = isEightQueensSolution(in2);\r\nassert(isequal(out2, 1));\r\n\r\n%%\r\n% Unique solution #10\r\nin3 = [ ...\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0 ];\r\nout3 = isEightQueensSolution(in3);\r\nassert(isequal(out3, 1));\r\n\r\n%%\r\n% Unique solution #11\r\nin4 = [ ...\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 1 0 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 0 1 0 0 0 0 0 ];\r\nout4 = isEightQueensSolution(in4);\r\nassert(isequal(out4, 1));\r\n\r\n%%\r\nin5 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout5 = isEightQueensSolution(in5);\r\nassert(isequal(out5, 0));\r\n\r\n%%\r\nin6 = [ ...\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    0 0 0 1 0 0 0 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout6 = isEightQueensSolution(in6);\r\nassert(isequal(out6, 0));\r\n\r\n%%\r\nin7 = [ ...\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 1 0 0 0 ];\r\nout7 = isEightQueensSolution(in7);\r\nassert(isequal(out7, 0));\r\n\r\n%%\r\nin8 = [ ...\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 1 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 1 0 0 1\r\n    0 0 0 0 0 0 0 0\r\n    0 1 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 0 1 0 0 0 0 0 ];\r\nout8 = isEightQueensSolution(in8);\r\nassert(isequal(out8, 0));\r\n\r\n%%\r\n% Only 7 queens\r\nin9 = [ ...\r\n    0 0 0 0 1 0 0 0\r\n    0 0 1 0 0 0 0 0\r\n    0 0 0 0 0 0 0 1\r\n    0 0 0 1 0 0 0 0\r\n    0 0 0 0 0 0 0 0\r\n    1 0 0 0 0 0 0 0\r\n    0 0 0 0 0 1 0 0\r\n    0 1 0 0 0 0 0 0 ];\r\nout9 = isEightQueensSolution(in9);\r\nassert(isequal(out9, 0));\r\n\r\n%%\r\n% Row and column constraint satisfied but \r\n% not diagonal constraint.\r\nin10 = eye(8);\r\nout10 = isEightQueensSolution(in10);\r\nassert(isequal(out10, 0));\r\n\r\n%%\r\n% Row and column constraint satisfied but \r\n% not diagonal constraint.\r\nin10 = flip(eye(8));\r\nout10 = isEightQueensSolution(in10);\r\nassert(isequal(out10, 0));","published":true,"deleted":false,"likes_count":6,"comments_count":2,"created_by":4303371,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":168,"test_suite_updated_at":"2022-01-07T08:34:21.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-02-11T12:21:25.000Z","updated_at":"2026-03-23T21:10:35.000Z","published_at":"2012-02-11T12:55:24.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\u003eWrite a function to verify whether an arrangement of queens on a chessboard is a valid solution to the classic\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=\\\"\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eeight queens 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\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\u003eIn the eight queens problem, eight queens must be placed on a chessboard such that no two queens attack each other. That is, no two queens can share the same row, column, or diagonal. The diagram below is one possible solution:\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=\\\"center\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"verticalAlign\\\" w:val=\\\"baseline\\\"/\u003e\u003cw:attr w:name=\\\"altText\\\" w:val=\\\"\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\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\u003eYour function should take an 8-by-8 matrix of 0s and 1s, where the 1s represent the position of the queens, and return a logical 1 if the solution is valid or a logical 0 otherwise.\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\u003eEXAMPLE 1\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[   in1 = [ ...\\n       0 0 0 1 0 0 0 0\\n       0 0 0 0 0 0 1 0\\n       0 0 1 0 0 0 0 0\\n       0 0 0 0 0 0 0 1\\n       0 1 0 0 0 0 0 0\\n       0 0 0 0 1 0 0 0\\n       1 0 0 0 0 0 0 0\\n       0 0 0 0 0 1 0 0 ];\\n\\n   isEightQueensSolution(in1)]]\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\u003ereturns 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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eEXAMPLE 2\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[   in2 = [ ...\\n       0 0 0 1 0 0 0 0\\n       0 0 0 0 0 0 1 0\\n       0 0 1 0 0 0 0 0\\n       0 0 0 0 0 0 0 1\\n       0 1 0 0 0 0 0 0\\n       1 0 0 0 0 0 0 0\\n       0 0 0 0 1 0 0 0\\n       0 0 0 0 0 1 0 0 ];\\n\\n   isEightQueensSolution(in2)]]\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\u003ereturns 0. (Notice that the queens on the bottom two rows share a diagonal.)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"target\":\"/media/image1.png\",\"relationshipId\":\"rId1\"}]},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARoAAAEaCAIAAABB0Q/tAAAXF0lEQVR42u2de2xVVdrGe6X0tKXtodRS6rHtqYci6MBQoZCGaYDwqcOIgwQQIVSFMioKgToIRjJgIChyB8XCAFViJhnjhcmIcdAQnBj+KF4y/uGFQWIMIpLSeKmkgHxPu5jFbu33TTzdhdOu385mZ593v2vlPH3XL2uvczj7iXuGjY3Npy1O/y5ebLwy+6C6Z6/MjiIUXXlF4IQiFIFTty3VwB2bw2tX6sjgAydK9QsUFa9efu3i+ZHt622kcMXS5H45cXFxOurcxiPPrCt4eJ7ywQmcKFUHe+6MKUkpKcFgMDm3X8m6VSYYGFy6cOHCr776Skedm6Amq6S+2cpUvlqBEzi5XqqBz23oP2dW/7mzzVxUumtrQiD1pZdeam5unjx5cva435i03oWhTZs2Xbx4UUedm6CuKkeZylcrtb3U4dzZ6lMn4ARODpWqdPe2wKCBxcXF4XC4V16u1kVCIj4l5Y033rhw4cLdd9+dVVlh3pUIyczKmjZtmo46N0FdVY4yla9WaqseUsNF6q2kpCQwsGRg7SZwAidXShVauqhfv35nzpw5d+5cXl6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pPerKkqFIkdxamg47otRpP2onVKhyF2cmppOBoPZnTSKVA8//7kupUKRiz8fXLTowU4aRaoHSoUicGrZT578LC8vN2qjSLVVD5QKReB0aV+5clnURpFqS6lQBE6X98OHD0RtFKm2lApF4HR5b24+HbVRpHlWBKVCETi1wSk6o0hwQhE4tdnffvtvURtFqi2lQhE4tXn2Q9RGke2eLUGpUOQ6TuXlZVEbRaotpUIROF3az59vqKqaEQikRmEUmZSUOH36nR0unygVitx9qPLp08f27q1dtOjBCRPGDhkyKBjMzsrKbPd/YRVRvLAwpBxlKr/DL3ApFYp45H8Hs9bRo+97d/v0FUqFInDC3wlFKAInBh+KYhMn/oIoQlHnd3BCEYrAicEXM4pwdgUnFEWjCGdXcEKRP4pwdgUnFEWpCGdXcAInfxTh7ApO4OSbIpxdwQmcfFOEsys4gZOfinB2BSdw8lMRzq7gBE5+KsLZFZzAyTdFOLuCEzj5qQhnV3ACJ98U4ewKTuDkmyKcXcEJnHxThLMrOIGTb4pwdgUncPJNEc6u4AROvinC2RWcwMk3RTi7ghM4+akIZ1dwQpFvinB2BScU+akIZ1dwQpFvinB2BScU+aYIZ1dwQpHPOOHsCk4o8kERzq7ghCLfFOHsCk4o8k0Rzq7ghCJ/FOHsCk4o8lkRzq7ghKIuVISzKzihCEXgxOBDUXfBiY2NzZftfwHAyDu2GXeLKAAAAABJRU5ErkJggg==\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":45237,"title":"Queen's move - 02","description":"In continuation with the problem-45236 ... \r\nIn the previous problem, it was assumed that there were no other chess pieces on the board... Now lets assume there is a number of king present on the board whose location is given in an array *p* . Now, check for the validity of Queen's moves.\r\n\r\n# x={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'}\r\n# p={'Kd4','Ke5','Kh7','Ke7'}\r\n\r\noutput=[1,1,0,1,0,1,1,0,0,0]\r\n\r\nkindly see this problem for understanding\r\n\u003chttps://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\u003e\r\n","description_html":"\u003cp\u003eIn continuation with the problem-45236 ... \r\nIn the previous problem, it was assumed that there were no other chess pieces on the board... Now lets assume there is a number of king present on the board whose location is given in an array \u003cb\u003ep\u003c/b\u003e . Now, check for the validity of Queen's moves.\u003c/p\u003e\u003col\u003e\u003cli\u003ex={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'}\u003c/li\u003e\u003cli\u003ep={'Kd4','Ke5','Kh7','Ke7'}\u003c/li\u003e\u003c/ol\u003e\u003cp\u003eoutput=[1,1,0,1,0,1,1,0,0,0]\u003c/p\u003e\u003cp\u003ekindly see this problem for understanding \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\u003c/a\u003e\u003c/p\u003e","function_template":"function z = Queen_move_3(x,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nx={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'};\r\np={'Kd4','Ke5','Kh7','Ke7'};\r\ny_correct = [1,1,0,1,0,1,1,0,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qd1','Qd5','Qf1','Qa8','Qf7','Qb2','Qc7'};\r\np={'Kd4','Ke5','Kh7','Ke7'};\r\ny_correct = [1,0,1,0,1,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qh7','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7'};\r\np={'Kd4','Ke5','Kh7','Ke7'};\r\ny_correct = [0,0,0,0,0,0,0,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qh7','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7'};\r\np={'Ka8','Kb2','Kd7','Kf3','Kg6'};\r\ny_correct = [1,1,1,0,0,0,0,0,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n\r\n%%\r\nx={'Qh7','Qh1','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qg2','Qg7','Qf1','Qf7','Qf2','Qa2'};\r\np={'Ka8','Kb2','Kd7','Kf3','Kg6'};\r\ny_correct = [1,1,0,0,0,0,0,0,1,0,1,0,1,0];\r\nassert(isequal(Queen_move_3(x,p),y_correct))\r\n","published":true,"deleted":false,"likes_count":2,"comments_count":3,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":8,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-20T23:00:44.000Z","updated_at":"2026-01-23T12:47:14.000Z","published_at":"2019-12-20T23:01: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\u003eIn continuation with the problem-45236 ... In the previous problem, it was assumed that there were no other chess pieces on the board... Now lets assume there is a number of king present on the board whose location is given in an array\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\u003ep\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e . Now, check for the validity of Queen's moves.\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ex={'Qd1','Qh1','Qh8','Qd5','Qg5','Qc5','Qa7','Qf2','Qe7','Qh7'}\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=\\\"2\\\"/\u003e\u003c/w:numPr\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ep={'Kd4','Ke5','Kh7','Ke7'}\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=[1,1,0,1,0,1,1,0,0,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\u003ekindly see this problem for understanding\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/45236-queen-s-move\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/45236-queen-s-move\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\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":45332,"title":"Castling-03","description":"Given the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (white king).\r\n\r\n* a=position of white pieces\r\n* b=position of black pieces\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Castling\u003e\r\n\r\nPrevious problem \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\u003e\r\n\r\n\r\n","description_html":"\u003cp\u003eGiven the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (white king).\u003c/p\u003e\u003cul\u003e\u003cli\u003ea=position of white pieces\u003c/li\u003e\u003cli\u003eb=position of black pieces\u003c/li\u003e\u003c/ul\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Castling\"\u003ehttps://en.wikipedia.org/wiki/Castling\u003c/a\u003e\u003c/p\u003e\u003cp\u003ePrevious problem \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\u003c/a\u003e\u003c/p\u003e","function_template":"function tf=castling_03(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\na={'Rd1','Rh1','Ke1'}\r\n b={'Nc6','Bg1','g5','Rh8'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Rd1','Rh1','Ke1'}\r\nb={'Nc6','d3','g5','Rh8','Qb8'}\r\nassert(isequal(castling_03(a,b),1))\r\n\r\n%%\r\na={'Qe1','Rh1','Kd2','Nf7'}\r\nb={'Nc6','d3','g5','Rh8','Qb8'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Qe1','Rh1','Kd2','Nf7'}\r\nb={'Nc6','d3','g5','Rh8','Qc1'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Qf1','Rh1','Ra1','Ke1'}\r\nb={'Ng1','h3','Rg5','Nb1','Qa8'}\r\nassert(isequal(castling_03(a,b),0))\r\n\r\n%%\r\na={'Qf1','Rh1','Ra1','Ke1'}\r\nb={'Ng1','h3','Rg5','Nb5','Qa8'}\r\nassert(isequal(castling_03(a,b),1))\r\n\r\n%%\r\na={'Qf1','Rh1','Ra1','Ke1'}\r\n b={'Ba8','Bg7','Rh6','Rb2'}\r\nassert(isequal(castling_03(a,b),1))\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":3,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":9,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-02-16T12:59:11.000Z","updated_at":"2026-01-23T14:02:57.000Z","published_at":"2020-02-16T13:24:25.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 the position of different chess pieces on the chessboard, figure out whether castling is valid or not in the next move (white king).\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=position of white pieces\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\u003eb=position of black pieces\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/Castling\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Castling\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\u003ePrevious 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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/45330-castling-02#\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\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":45418,"title":"En passant - 01","description":"This is white's turn. The player moves his pawn.\r\n\r\nThe pawn's previous and current positions are given.\r\n\r\nDetermine whether the move was valid.\r\n\r\n pawn's previous pos = 'b2'\r\n pawn's previous pos = 'c3'\r\n\r\nSo this is a valid move provided there was an opponent piece on c3.\r\n\r\nBut for now, just check the validity of the move. Opponent's pieces will be added in the next problem.\r\n\r\n\u003chttps://en.wikipedia.org/wiki/Chess#Movement\u003e\r\n","description_html":"\u003cp\u003eThis is white's turn. The player moves his pawn.\u003c/p\u003e\u003cp\u003eThe pawn's previous and current positions are given.\u003c/p\u003e\u003cp\u003eDetermine whether the move was valid.\u003c/p\u003e\u003cpre\u003e pawn's previous pos = 'b2'\r\n pawn's previous pos = 'c3'\u003c/pre\u003e\u003cp\u003eSo this is a valid move provided there was an opponent piece on c3.\u003c/p\u003e\u003cp\u003eBut for now, just check the validity of the move. Opponent's pieces will be added in the next problem.\u003c/p\u003e\u003cp\u003e\u003ca href = \"https://en.wikipedia.org/wiki/Chess#Movement\"\u003ehttps://en.wikipedia.org/wiki/Chess#Movement\u003c/a\u003e\u003c/p\u003e","function_template":"function tf = en_passant(w1,w2)","test_suite":"%%\r\nassert(isequal(en_passant('b2','c3'),1))\r\n%%\r\nassert(isequal(en_passant('a2','a3'),1))\r\n%%\r\nassert(isequal(en_passant('d3','d5'),0))\r\n%%\r\nassert(isequal(en_passant('e5','d4'),0))\r\n%%\r\nassert(isequal(en_passant('e5','c6'),0))\r\n%%\r\nassert(isequal(en_passant('e5','d6'),1))\r\n%%\r\nassert(isequal(en_passant('b2','b4'),1))\r\n%%\r\nassert(isequal(en_passant('b2','c2'),0))\r\n%%\r\nassert(isequal(en_passant('a1','a2'),0))\r\n%%\r\nassert(isequal(en_passant('g7','g8'),1))\r\n%%\r\nassert(isequal(en_passant('g7','g6'),0))\r\n%%\r\nassert(isequal(en_passant('f5','h6'),0))\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":17,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-04-02T03:21:50.000Z","updated_at":"2026-01-23T14:14:44.000Z","published_at":"2020-04-02T03:23:17.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 white's turn. The player moves his pawn.\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 pawn's previous and current positions are given.\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\u003eDetermine whether the move was valid.\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[ pawn's previous pos = 'b2'\\n pawn's previous pos = 'c3']]\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\u003eSo this is a valid move provided there was an opponent piece on c3.\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\u003eBut for now, just check the validity of the move. Opponent's pieces will be added in the next problem.\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/Chess#Movement\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://en.wikipedia.org/wiki/Chess#Movement\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\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":113,"title":"N-Queens Checker","description":"Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix, a, filled mostly with zeros, while the queens are given as ones. Your job is to verify that the board is a legitimate answer to the \u003chttp://en.wikipedia.org/wiki/Eight_queens_puzzle N-Queens problem\u003e. The board is good only when no queen can \"see\" (and thus capture) another queen.\r\n\r\nExample\r\n\r\nThe matrix below shows two queens on a 3-by-3 chessboard. The queens can't see each other, so the function should return TRUE.\r\n\r\n 1 0 0\r\n 0 0 1\r\n 0 0 0\r\n\r\nHere is a bigger board with more queens. Since the queens on rows 3 and 4 are adjacent along a diagonal, they can see each other and the function should return FALSE.\r\n\r\n 0 0 0 1\r\n 1 0 0 0\r\n 0 0 1 0 \r\n 0 1 0 0\r\n\r\nThe board doesn't have to be square, but it always has 2 or more rows and 2 or more columns. This matrix returns FALSE.\r\n\r\n 1 0 0 0 0 \r\n 0 0 0 1 1\r\n","description_html":"\u003cp\u003ePicture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix, a, filled mostly with zeros, while the queens are given as ones. Your job is to verify that the board is a legitimate answer to the \u003ca href=\"http://en.wikipedia.org/wiki/Eight_queens_puzzle\"\u003eN-Queens problem\u003c/a\u003e. The board is good only when no queen can \"see\" (and thus capture) another queen.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003eThe matrix below shows two queens on a 3-by-3 chessboard. The queens can't see each other, so the function should return TRUE.\u003c/p\u003e\u003cpre\u003e 1 0 0\r\n 0 0 1\r\n 0 0 0\u003c/pre\u003e\u003cp\u003eHere is a bigger board with more queens. Since the queens on rows 3 and 4 are adjacent along a diagonal, they can see each other and the function should return FALSE.\u003c/p\u003e\u003cpre\u003e 0 0 0 1\r\n 1 0 0 0\r\n 0 0 1 0 \r\n 0 1 0 0\u003c/pre\u003e\u003cp\u003eThe board doesn't have to be square, but it always has 2 or more rows and 2 or more columns. This matrix returns FALSE.\u003c/p\u003e\u003cpre\u003e 1 0 0 0 0 \r\n 0 0 0 1 1\u003c/pre\u003e","function_template":"function tf = queens(a)\r\n  tf = true;\r\nend","test_suite":"%%\r\n\r\na = [1 0 0; 0 0 1; 0 0 0];\r\ntf_correct = true;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [0 0 0 1; 1 0 0 0; 0 0 1 0; 0 1 0 0];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0 0 0 0; 0 0 0 1 1];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n\r\n%%\r\n\r\na = [ ...\r\n  0 0 1 0 0 0 0 0; 0 0 0 0 0 0 1 0; 0 1 0 0 0 0 0 0; 0 0 0 0 0 0 0 1;\r\n  0 0 0 0 0 1 0 0; 0 0 0 1 0 0 0 0; 1 0 0 0 0 0 0 0; 0 0 0 0 1 0 0 0];\r\ntf_correct = true;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = ones(15,7);\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = zeros(20,23);\r\na(1,22) = 1;\r\na(2,23) = 1;\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0; 0 1];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0 1; 0 0 0; 0 1 0];\r\ntf_correct = false;\r\nassert(isequal(queens(a),tf_correct))\r\n","published":true,"deleted":false,"likes_count":4,"comments_count":0,"created_by":7,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":311,"test_suite_updated_at":"2017-03-15T16:59:10.000Z","rescore_all_solutions":true,"group_id":1,"created_at":"2012-01-26T20:33:45.000Z","updated_at":"2026-03-23T21:08:43.000Z","published_at":"2012-01-30T15: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\u003ePicture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix, a, filled mostly with zeros, while the queens are given as ones. Your job is to verify that the board is a legitimate answer to 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://en.wikipedia.org/wiki/Eight_queens_puzzle\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eN-Queens problem\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. The board is good only when no queen can \\\"see\\\" (and thus capture) another queen.\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=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe matrix below shows two queens on a 3-by-3 chessboard. The queens can't see each other, so the function should return TRUE.\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[ 1 0 0\\n 0 0 1\\n 0 0 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\u003eHere is a bigger board with more queens. Since the queens on rows 3 and 4 are adjacent along a diagonal, they can see each other and the function should return FALSE.\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[ 0 0 0 1\\n 1 0 0 0\\n 0 0 1 0 \\n 0 1 0 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\u003eThe board doesn't have to be square, but it always has 2 or more rows and 2 or more columns. This matrix returns FALSE.\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[ 1 0 0 0 0 \\n 0 0 0 1 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":45389,"title":"Knight's Watch","description":"  \"Night gathers, and now my watch begins\"\r\n\r\nA knight is placed on an n-by-n sized chessboard at the position x. Find the probability that after k steps, the knight will remain within the chessboard.\r\n\r\nAny knight's move that places him outside the board should be considered invalid.\r\n\r\n For simplicity, the knight's position on the chessboard is defined with the numeric\r\n notation instead of algebraic notation. so 'Ka1' is represented as (1,1).\r\n\r\nBrief explanation:\r\n\r\n  Say the knight is placed in pos-(1,1). A knight has 8 possible moves. So in the next move, \r\nthe Knight can go to 8 different positions in the chessboard. But among them, only 2\r\n positions are valid i.e. the knight remains within the chessboard and they are -\r\n(3,2) \u0026 (2,3). So the prob. is 2/8 after 1 move. What will be the probability after k moves?\r\n\r\n","description_html":"\u003cpre class=\"language-matlab\"\u003e\"Night gathers, and now my watch begins\"\r\n\u003c/pre\u003e\u003cp\u003eA knight is placed on an n-by-n sized chessboard at the position x. Find the probability that after k steps, the knight will remain within the chessboard.\u003c/p\u003e\u003cp\u003eAny knight's move that places him outside the board should be considered invalid.\u003c/p\u003e\u003cpre\u003e For simplicity, the knight's position on the chessboard is defined with the numeric\r\n notation instead of algebraic notation. so 'Ka1' is represented as (1,1).\u003c/pre\u003e\u003cp\u003eBrief explanation:\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eSay the knight is placed in pos-(1,1). A knight has 8 possible moves. So in the next move, \r\nthe Knight can go to 8 different positions in the chessboard. But among them, only 2\r\npositions are valid i.e. the knight remains within the chessboard and they are -\r\n(3,2) \u0026 (2,3). So the prob. is 2/8 after 1 move. What will be the probability after k moves?\r\n\u003c/pre\u003e","function_template":"function prob = knights_watch(x,n,k)","test_suite":"%%\r\nx =[1,1];\r\nassert(isequal(knights_watch(x,3,2),0.0625))\r\n%%\r\nx =[1,1];\r\nassert(isequal(knights_watch(x,4,4),0.0176))\r\n%%\r\nx =[6,4];\r\nassert(isequal(knights_watch(x,6,9),0.012))\r\n%%\r\nx =[6,4];\r\nassert(isequal(knights_watch(x,8,25),0.0011))\r\n%%\r\nx =[8,8];\r\nassert(isequal(knights_watch(x,8,15),0.0042))\r\n%%\r\nx =[8,8];\r\nassert(isequal(knights_watch(x,16,15),0.4666))\r\n%%\r\nx =[3,1];\r\nassert(isequal(knights_watch(x,16,50),0.0037))","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":13,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2020-03-25T18:55:22.000Z","updated_at":"2026-01-23T12:14:39.000Z","published_at":"2020-03-25T18:55:22.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=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[\\\"Night gathers, and now my watch begins\\\"]]\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\u003eA knight is placed on an n-by-n sized chessboard at the position x. Find the probability that after k steps, the knight will remain within the chessboard.\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\u003eAny knight's move that places him outside the board should be considered invalid.\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[ For simplicity, the knight's position on the chessboard is defined with the numeric\\n notation instead of algebraic notation. so 'Ka1' is represented as (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\u003eBrief explanation:\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[Say the knight is placed in pos-(1,1). A knight has 8 possible moves. So in the next move, \\nthe Knight can go to 8 different positions in the chessboard. But among them, only 2\\npositions are valid i.e. the knight remains within the chessboard and they are -\\n(3,2) \u0026 (2,3). So the prob. is 2/8 after 1 move. What will be the probability after k moves?]]\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":45239,"title":"Checkmate-02","description":"This is an extension of the problem \u003chttps://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\u003e\r\n\r\nIf the king is in check, examine the next move of the king. List all those possible moves by which king can avoid the check by the next move.\r\n\r\nOtherwise 'checkmate'.\r\n\r\n* r = king's location\r\n* p = position of opponent's pieces\r\n\r\n* if the king is currently not in check, then he doesn't need to move. so return empty. \r\n\r\n* for simplicity, assume that the king cannot take out opponent's pieces.\r\n","description_html":"\u003cp\u003eThis is an extension of the problem \u003ca href = \"https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\"\u003ehttps://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\u003c/a\u003e\u003c/p\u003e\u003cp\u003eIf the king is in check, examine the next move of the king. List all those possible moves by which king can avoid the check by the next move.\u003c/p\u003e\u003cp\u003eOtherwise 'checkmate'.\u003c/p\u003e\u003cul\u003e\u003cli\u003er = king's location\u003c/li\u003e\u003cli\u003ep = position of opponent's pieces\u003c/li\u003e\u003c/ul\u003e\u003cul\u003e\u003cli\u003eif the king is currently not in check, then he doesn't need to move. so return empty.\u003c/li\u003e\u003c/ul\u003e\u003cul\u003e\u003cli\u003efor simplicity, assume that the king cannot take out opponent's pieces.\u003c/li\u003e\u003c/ul\u003e","function_template":"function pos=checkmate_2(r,p)\r\n  y = x;\r\nend","test_suite":"%%\r\nr = 'Kd4';\r\np={'Qe3','Rh3','Nc1','c6'};\r\npos = {'Kd5','Kc4'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kg6';\r\np={'Qe3','Rh3','Nc1','c6','Ke7'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kc8';\r\np={'Qe3','Rh3','Nc1','c6','Ke7','h5','Ba6'};\r\npos = {'Kc7','Kb8'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kh1';\r\np={'Qa3','Rb3','Nf2','c6','Kf7','h5','Ba6'};\r\npos = {'Kh2','Kg2','Kg1'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kg6';\r\np={'Qe3','Rh3','Nc1','c6'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kd4';\r\np={'Rh2','Na1','d1'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kb2';\r\np={'Na2','Na1','Na3'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kb2';\r\np={'Na2','Na1','Na3','c1','c3'};\r\npos = [];\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kb2';\r\np={'Na2','Na1','Na3','Bg7' };\r\npos = 'checkmate';\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Kg6';\r\np={'Nf5','Rg1','g4','Qe2','Bf1','Kc3' };\r\npos =  {'Kh7','Kf7','Kf6'};\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nr = 'Ka1';\r\np={'Qa3','Rb3','Nf2','c6','Kf7','h5','Ba6'};\r\npos =  'checkmate';\r\nassert(isequal(checkmate_2(r,p),pos))\r\n\r\n%%\r\nfiletext = fileread('checkmate_2.m');\r\nassert(isempty(strfind(filetext, 'regexp')),'regexp() forbidden')\r\nassert(isempty(strfind(filetext, 'regexprep')),'regexprep() forbidden')\r\nassert(isempty(strfind(filetext, 'strfind')),'strfind() forbidden')\r\nassert(isempty(strfind(filetext, 'strcmp')),'strcmp() forbidden')\r\n","published":true,"deleted":false,"likes_count":0,"comments_count":14,"created_by":363598,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":10,"test_suite_updated_at":"2019-12-29T04:16:28.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2019-12-21T01:40:07.000Z","updated_at":"2026-01-23T13:22:55.000Z","published_at":"2019-12-21T21:38:46.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 an extension of the 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=\\\"https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\\\"\u003e\u003cw:r\u003e\u003cw:t\u003e\u0026lt;https://www.mathworks.com/matlabcentral/cody/problems/45238-checkmate\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\u003eIf the king is in check, examine the next move of the king. List all those possible moves by which king can avoid the check by the next move.\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\u003eOtherwise 'checkmate'.\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\u003er = king's location\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\u003ep = position of opponent's pieces\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\u003eif the king is currently not in check, then he doesn't need to move. so return empty.\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\u003efor simplicity, assume that the king cannot take out opponent's pieces.\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":96,"title":"Knight's Tour Checker","description":"Given a matrix a, determine whether or not a legal \u003chttp://en.wikipedia.org/wiki/Knight's_tour knight's tour\u003e is present. The knight's tour always follows the pattern 1, 2, 3, ... but it need not fill the entire matrix. Any unused squares contain zeros. Your function should return true if the counting sequence from 1 to n represents a knight's tour, and false if not.\r\n\r\nExample\r\n\r\nThe matrix a as given below is a legal knight's tour. The middle square is unreachable, but since it contains a zero, it satisfies the condition. The function should return TRUE.\r\n\r\n  7     2     5\r\n  4     0     8\r\n  1     6     3\r\n\r\nHere is another legal (if short) knight's tour. The test suite will always contain at least one move (i.e. the counting sequence [1 2]). Note the matrix is not required to be square.\r\n\r\n  1     0     0\r\n  0     0     2\r\n \r\nHere is an illegal knight's tour. Everything is fine up until the jump from 14 to 15, which is illegal because it jumps from row 4 to row 1.\r\n\r\n 15     5    12     3\r\n  0     2     9     6\r\n  8    11     4    13\r\n  1    14     7    10","description_html":"\u003cp\u003eGiven a matrix a, determine whether or not a legal \u003ca href=\"http://en.wikipedia.org/wiki/Knight's_tour\"\u003eknight's tour\u003c/a\u003e is present. The knight's tour always follows the pattern 1, 2, 3, ... but it need not fill the entire matrix. Any unused squares contain zeros. Your function should return true if the counting sequence from 1 to n represents a knight's tour, and false if not.\u003c/p\u003e\u003cp\u003eExample\u003c/p\u003e\u003cp\u003eThe matrix a as given below is a legal knight's tour. The middle square is unreachable, but since it contains a zero, it satisfies the condition. The function should return TRUE.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e7     2     5\r\n4     0     8\r\n1     6     3\r\n\u003c/pre\u003e\u003cp\u003eHere is another legal (if short) knight's tour. The test suite will always contain at least one move (i.e. the counting sequence [1 2]). Note the matrix is not required to be square.\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e1     0     0\r\n0     0     2\r\n\u003c/pre\u003e\u003cp\u003eHere is an illegal knight's tour. Everything is fine up until the jump from 14 to 15, which is illegal because it jumps from row 4 to row 1.\u003c/p\u003e\u003cpre\u003e 15     5    12     3\r\n  0     2     9     6\r\n  8    11     4    13\r\n  1    14     7    10\u003c/pre\u003e","function_template":"function tf = knights_tour(a)\r\n  tf = true;\r\nend","test_suite":"%%\r\n\r\na = ...\r\n[ 7     2     5\r\n  4     0     8\r\n  1     6     3];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = ...\r\n[ 1     0   0\r\n  0     0   2];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = ...\r\n[ 15     5    12     3\r\n   0     2     9     6\r\n   8    11     4    13\r\n   1    14     7    10];\r\ntf_correct = false;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = ...\r\n[  0     5    12     3\r\n  15     2     9     6\r\n   8    11     4    13\r\n   1    14     7    10];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = [22 29 4 31 16 35;3 32 23 34 5 14;28 21 30 15 36 17;9 2 33 24 13 6;20 27 8 11 18 25;1 10 19 26 7 12];\r\ntf_correct = true;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = [22 29 4 31 16 35;3 32 23 34 5 14;28 21 30 15 0 17;2 9 33 24 13 6;20 27 8 11 18 25;1 10 19 26 7 12];\r\ntf_correct = false;\r\nassert(isequal(knights_tour(a),tf_correct))\r\n\r\n%%\r\n\r\na = [1 0 0;0 0 0;2 0 0];\r\ntf_correct = false;\r\nassert(isequal(knights_tour(a),tf_correct))","published":true,"deleted":false,"likes_count":24,"comments_count":4,"created_by":1,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1472,"test_suite_updated_at":"2016-01-13T18:56:25.000Z","rescore_all_solutions":false,"group_id":2,"created_at":"2012-01-18T01:00:30.000Z","updated_at":"2026-04-05T02:15:43.000Z","published_at":"2012-01-18T01:00:30.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 matrix a, determine whether or not a legal\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/Knight's_tour\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eknight's tour\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is present. The knight's tour always follows the pattern 1, 2, 3, ... but it need not fill the entire matrix. Any unused squares contain zeros. Your function should return true if the counting sequence from 1 to n represents a knight's tour, and false if 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\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\u003eThe matrix a as given below is a legal knight's tour. The middle square is unreachable, but since it contains a zero, it satisfies the condition. The function should return TRUE.\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[7     2     5\\n4     0     8\\n1     6     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\u003eHere is another legal (if short) knight's tour. The test suite will always contain at least one move (i.e. the counting sequence [1 2]). Note the matrix is not required to be square.\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[1     0     0\\n0     0     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\u003eHere is an illegal knight's tour. Everything is fine up until the jump from 14 to 15, which is illegal because it jumps from row 4 to row 1.\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[ 15     5    12     3\\n  0     2     9     6\\n  8    11     4    13\\n  1    14     7    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\"}]}"}],"term":"group:Chess","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":"group:Chess","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"group":[["group:Chess","","","Chess",""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f17c2e63490\u003e":["Chess"],"#\u003cMathWorks::Search::Field:0x00007f17c2e633f0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f17c2e62a90\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f17c2e637b0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f17c2e63710\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f17c2e63670\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f17c2e635d0\u003e":"group:Chess"},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f17c2e635d0\u003e":"group:Chess"},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007f17c2e63490\u003e":["Chess"]}},"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,"time":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":"group:Chess","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"group":[["group:Chess","","","Chess",""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f17c2e63490\u003e":["Chess"],"#\u003cMathWorks::Search::Field:0x00007f17c2e633f0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f17c2e62a90\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f17c2e637b0\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f17c2e63710\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f17c2e63670\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f17c2e635d0\u003e":"group:Chess"},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f17c2e635d0\u003e":"group:Chess"},"queried_facets":{"#\u003cMathWorks::Search::Field:0x00007f17c2e63490\u003e":["Chess"]}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":54770,"difficulty_rating":"easy"},{"id":45427,"difficulty_rating":"easy-medium"},{"id":45240,"difficulty_rating":"easy-medium"},{"id":45329,"difficulty_rating":"easy-medium"},{"id":45336,"difficulty_rating":"easy-medium"},{"id":3057,"difficulty_rating":"easy-medium"},{"id":45330,"difficulty_rating":"easy-medium"},{"id":45236,"difficulty_rating":"easy-medium"},{"id":315,"difficulty_rating":"easy-medium"},{"id":45433,"difficulty_rating":"medium"},{"id":45238,"difficulty_rating":"medium"},{"id":306,"difficulty_rating":"medium"},{"id":45237,"difficulty_rating":"medium"},{"id":45332,"difficulty_rating":"medium"},{"id":45418,"difficulty_rating":"medium"},{"id":113,"difficulty_rating":"medium"},{"id":45389,"difficulty_rating":"medium"},{"id":45239,"difficulty_rating":"medium-hard"},{"id":96,"difficulty_rating":"medium-hard"}]}}