{"group":{"group":{"id":115,"name":"Classic Game Puzzles","lockable":false,"created_at":"2019-01-18T07:03:58.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"A collection of problems directly related to the gameplay and mechanics of a few classics; chess, sudoku and the sliding puzzle.","is_default":false,"created_by":15521,"badge_id":62,"featured":false,"trending":false,"solution_count_in_trending_period":3,"trending_last_calculated":"2026-04-06T00:00:00.000Z","image_id":428,"published":true,"community_created":true,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"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\u003eA collection of problems directly related to the gameplay and mechanics of a few classics; chess, sudoku and the sliding puzzle.\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\"}]}","description_html":"\u003cdiv style = \"text-align: start; line-height: normal; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"display: block; min-width: 0px; padding-top: 0px; perspective-origin: 289.5px 21px; transform-origin: 289.5px 21px; \"\u003e\u003cdiv style=\"font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-bottom: 9px; margin-left: 4px; margin-right: 10px; margin-top: 2px; text-align: left; white-space: pre-wrap; perspective-origin: 266.5px 21px; transform-origin: 266.5px 21px; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"display: inline; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eA collection of problems directly related to the gameplay and mechanics of a few classics; chess, sudoku and the sliding puzzle.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","published_at":"2019-05-08T20:17:00.000Z"},"current_player":null},"problems":[{"id":141,"title":"Solve the Sudoku Row","description":"*Description*\r\n\r\nA simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The task is, given the row (or column or square) of a Sudoku puzzle with only a single number missing, fill in the missing number and return a completed row.\r\n\r\nFor more information regarding Sudoku, refer to the \u003chttp://en.wikipedia.org/wiki/Sudoku Wikipedia Entry for Sudoku\u003e.\r\n\r\nThe input will be in the form of a vector (row or column) or a 9x9 matrix and the output has to have the same dimensionality as the input. Blank entries are signified with the number 0. There will always be one and only one blank entry in the input.\r\n\r\n*Example*\r\n\r\n     input  = [ 1 2 3 4 0 6 7 8 9 ];\r\n     output = [ 1 2 3 4 5 6 7 8 9 ]; ","description_html":"\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eA simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The task is, given the row (or column or square) of a Sudoku puzzle with only a single number missing, fill in the missing number and return a completed row.\u003c/p\u003e\u003cp\u003eFor more information regarding Sudoku, refer to the \u003ca href=\"http://en.wikipedia.org/wiki/Sudoku\"\u003eWikipedia Entry for Sudoku\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe input will be in the form of a vector (row or column) or a 9x9 matrix and the output has to have the same dimensionality as the input. Blank entries are signified with the number 0. There will always be one and only one blank entry in the input.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e\u003cpre\u003e     input  = [ 1 2 3 4 0 6 7 8 9 ];\r\n     output = [ 1 2 3 4 5 6 7 8 9 ]; \u003c/pre\u003e","function_template":"function y = solveSudokuRow(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx = [8 3 4 0 6 7 1 2 9];\r\ny_correct = [8 3 4 5 6 7 1 2 9];\r\nassert(isequal(solveSudokuRow(x),y_correct))\r\n\r\n%%\r\nx = [ 3 5 7\r\n      1 6 8\r\n      0 2 9 ];\r\ny_correct = ...\r\n    [ 3 5 7\r\n      1 6 8\r\n      4 2 9 ];\r\nassert(isequal(solveSudokuRow(x),y_correct))\r\n\r\n%%\r\nx = [ 2 8 0 7 3 9 6 5 4 ]';\r\ny_correct = [ 2 8 1 7 3 9 6 5 4 ]';\r\nassert(isequal(solveSudokuRow(x),y_correct))","published":true,"deleted":false,"likes_count":18,"comments_count":5,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":1061,"test_suite_updated_at":"2012-01-28T09:25:14.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-28T09:25:14.000Z","updated_at":"2026-03-23T11:33:31.000Z","published_at":"2012-01-28T09:25:14.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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\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 simple yet tedious task occurs near the end of most Sudoku-solving algorithms, computerized or manual. The task is, given the row (or column or square) of a Sudoku puzzle with only a single number missing, fill in the missing number and return a completed row.\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 more information regarding Sudoku, refer 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/Sudoku\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWikipedia Entry for Sudoku\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe input will be in the form of a vector (row or column) or a 9x9 matrix and the output has to have the same dimensionality as the input. Blank entries are signified with the number 0. There will always be one and only one blank entry in the input.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[     input  = [ 1 2 3 4 0 6 7 8 9 ];\\n     output = [ 1 2 3 4 5 6 7 8 9 ];]]\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":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\"}]}"},{"id":114,"title":"Check to see if a Sudoku Puzzle is Solved","description":"*Description:*\r\n\r\nYour task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integers represents a completed sudoku puzzle. For more information regarding sudokus, refer to the \u003chttp://en.wikipedia.org/wiki/Sudoku wikipedia page\u003e.\r\n\r\nThe function will return true only when it's a completed sudoku puzzle. A value of 0 refers to a blank entry.\r\n\r\n*Example:*\r\n\r\n   input = [ 8 2 4 9 5 3 6 7 1\r\n             6 3 5 8 1 7 9 2 4\r\n             7 1 9 6 2 4 8 5 3\r\n             5 8 7 2 9 1 3 4 6\r\n             1 4 2 7 3 6 5 8 9\r\n             3 9 6 4 8 5 2 1 7\r\n             2 6 1 5 4 9 7 3 8\r\n             4 7 8 3 6 2 1 9 5\r\n             9 5 3 1 7 8 4 6 2 ];\r\n   answer = true;\r\n\r\n   input = [ 8 2 4 9 5 3 6 7 1\r\n             6 3 5 8 1 7 9 2 4\r\n             7 1 9 0 2 4 8 5 3\r\n             5 8 7 2 9 1 3 4 6\r\n             1 4 2 7 3 0 5 8 9\r\n             3 9 6 4 8 5 2 1 7\r\n             2 6 1 5 4 9 7 3 8\r\n             4 7 8 3 6 2 1 9 5\r\n             9 5 3 1 7 8 4 6 2 ];\r\n    answer = false;","description_html":"\u003cp\u003e\u003cb\u003eDescription:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eYour task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integers represents a completed sudoku puzzle. For more information regarding sudokus, refer to the \u003ca href=\"http://en.wikipedia.org/wiki/Sudoku\"\u003ewikipedia page\u003c/a\u003e.\u003c/p\u003e\u003cp\u003eThe function will return true only when it's a completed sudoku puzzle. A value of 0 refers to a blank entry.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre\u003e   input = [ 8 2 4 9 5 3 6 7 1\r\n             6 3 5 8 1 7 9 2 4\r\n             7 1 9 6 2 4 8 5 3\r\n             5 8 7 2 9 1 3 4 6\r\n             1 4 2 7 3 6 5 8 9\r\n             3 9 6 4 8 5 2 1 7\r\n             2 6 1 5 4 9 7 3 8\r\n             4 7 8 3 6 2 1 9 5\r\n             9 5 3 1 7 8 4 6 2 ];\r\n   answer = true;\u003c/pre\u003e\u003cpre\u003e   input = [ 8 2 4 9 5 3 6 7 1\r\n             6 3 5 8 1 7 9 2 4\r\n             7 1 9 0 2 4 8 5 3\r\n             5 8 7 2 9 1 3 4 6\r\n             1 4 2 7 3 0 5 8 9\r\n             3 9 6 4 8 5 2 1 7\r\n             2 6 1 5 4 9 7 3 8\r\n             4 7 8 3 6 2 1 9 5\r\n             9 5 3 1 7 8 4 6 2 ];\r\n    answer = false;\u003c/pre\u003e","function_template":"function TF = sudokuIsSolved(S)\r\n  TF = all(S(:));\r\nend","test_suite":"%%\r\ninput = [ 8 2 4 9 5 3 6 7 1\r\n          6 3 5 8 1 7 9 2 4\r\n          7 1 9 6 2 4 8 5 3\r\n          5 8 7 2 9 1 3 4 6\r\n          1 4 2 7 3 6 5 8 9\r\n          3 9 6 4 8 5 2 1 7\r\n          2 6 1 5 4 9 7 3 8\r\n          4 7 8 3 6 2 1 9 5\r\n          9 5 3 1 7 8 4 6 2 ];\r\nTF_correct = true;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))\r\n\r\n%%\r\ninput = [ 8 2 4 9 5 3 6 7 1\r\n          6 3 5 8 1 7 9 2 4\r\n          7 1 9 6 2 4 8 5 3\r\n          5 8 7 2 9 1 3 4 6\r\n          1 4 2 7 3 6 5 8 9\r\n          3 9 6 4 8 5 2 1 7\r\n          2 6 1 5 4 9 7 3 8\r\n          4 7 8 3 6 2 1 9 5\r\n          9 5 3 1 7 8 4 2 6 ];\r\nTF_correct = false;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))\r\n\r\n%%\r\ninput = [ 8 2 4 9 5 3 6 7 1\r\n          3 6 5 8 1 7 9 1 4\r\n          7 1 9 0 2 4 8 5 3\r\n          5 8 7 2 9 1 3 4 6\r\n          1 4 2 7 3 0 5 8 9\r\n          6 9 6 4 8 5 2 1 7\r\n          2 3 1 5 4 9 7 3 8\r\n          4 7 8 3 6 2 1 9 5\r\n          9 5 3 1 7 8 4 6 2 ];\r\nTF_correct = false;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))\r\n\r\n%%\r\ninput = zeros(9,9);\r\nTF_correct = false;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))\r\n\r\n%%\r\ninput = meshgrid(1:9,1:9);\r\nTF_correct = false;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))\r\n\r\n%%\r\ninput = toeplitz([1 9:-1:2],1:9);\r\nTF_correct = false;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))\r\n\r\n%%\r\ninput = [ 1 9 8 5 2 6 3 4 7\r\n          7 2 5 3 4 1 6 9 8\r\n          3 4 6 9 7 8 2 1 5\r\n          9 8 1 2 5 7 4 6 3\r\n          5 6 4 1 3 9 8 7 2\r\n          2 3 7 6 8 4 1 5 9\r\n          4 7 3 8 1 5 9 2 6\r\n          8 1 9 7 6 2 5 3 4\r\n          6 5 2 4 9 3 7 8 1 ]\r\nTF_correct = true;\r\nassert(isequal(sudokuIsSolved(input),TF_correct))","published":true,"deleted":false,"likes_count":7,"comments_count":5,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":338,"test_suite_updated_at":"2012-02-11T16:33:37.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2012-01-27T05:13:20.000Z","updated_at":"2026-02-11T19:49:37.000Z","published_at":"2012-02-11T16:33:37.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYour task, should you choose to accept it, is to make a function that checks to see if a 9x9 matrix of integers represents a completed sudoku puzzle. For more information regarding sudokus, refer 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/Sudoku\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ewikipedia page\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe function will return true only when it's a completed sudoku puzzle. A value of 0 refers to a blank entry.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[   input = [ 8 2 4 9 5 3 6 7 1\\n             6 3 5 8 1 7 9 2 4\\n             7 1 9 6 2 4 8 5 3\\n             5 8 7 2 9 1 3 4 6\\n             1 4 2 7 3 6 5 8 9\\n             3 9 6 4 8 5 2 1 7\\n             2 6 1 5 4 9 7 3 8\\n             4 7 8 3 6 2 1 9 5\\n             9 5 3 1 7 8 4 6 2 ];\\n   answer = true;\\n\\n   input = [ 8 2 4 9 5 3 6 7 1\\n             6 3 5 8 1 7 9 2 4\\n             7 1 9 0 2 4 8 5 3\\n             5 8 7 2 9 1 3 4 6\\n             1 4 2 7 3 0 5 8 9\\n             3 9 6 4 8 5 2 1 7\\n             2 6 1 5 4 9 7 3 8\\n             4 7 8 3 6 2 1 9 5\\n             9 5 3 1 7 8 4 6 2 ];\\n    answer = false;]]\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":43018,"title":"Sudoku square","description":"We have a small Sudoku square, but one number is missing.\r\n\r\n x = [ 1 5 4\r\n       8 6 3\r\n       0 9 7 ]\r\n\r\nMake a function, where output is filled small Sudoku square\r\n\r\n y = [ 1 5 4\r\n       8 6 3\r\n       2 9 7 ]","description_html":"\u003cp\u003eWe have a small Sudoku square, but one number is missing.\u003c/p\u003e\u003cpre\u003e x = [ 1 5 4\r\n       8 6 3\r\n       0 9 7 ]\u003c/pre\u003e\u003cp\u003eMake a function, where output is filled small Sudoku square\u003c/p\u003e\u003cpre\u003e y = [ 1 5 4\r\n       8 6 3\r\n       2 9 7 ]\u003c/pre\u003e","function_template":"function y = sudoku(x)\r\n  y = x;\r\nend","test_suite":"%%\r\nx=[ 1 5 4;\r\n    8 6 3;\r\n    0 9 7];\r\ny_correct=[ 1 5 4;\r\n    8 6 3;\r\n    2 9 7];\r\nassert(isequal(sudoku(x),y_correct))\r\n\r\n\r\n%%\r\nx=[ 8 3 0;\r\n    2 7 1;\r\n    5 4 6];\r\ny_correct=[ 8 3 9;\r\n    2 7 1;\r\n    5 4 6];\r\nassert(isequal(sudoku(x),y_correct))","published":true,"deleted":false,"likes_count":34,"comments_count":0,"created_by":90955,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":443,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2016-10-04T14:01:29.000Z","updated_at":"2026-03-11T12:58:58.000Z","published_at":"2016-10-04T14:01:29.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\u003eWe have a small Sudoku square, but one number is missing.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ x = [ 1 5 4\\n       8 6 3\\n       0 9 7 ]]]\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\u003eMake a function, where output is filled small Sudoku 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[ y = [ 1 5 4\\n       8 6 3\\n       2 9 7 ]]]\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":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":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/Quh04cEDLp6amppSUFLUFJ3CiVJf30l1bhdOAAQPi4+NLS0tvvvnmOXPm3N/RpriuKsd+nm6eFQFO4ESp2uBUV1d34cIF703d/3PLp0zlgxM4Uar2e+jRhQLjhx9+OHLkiCBZuHCh7uumTJlS3nZTRHFdVY4yld/yW8NHF4ITOFGqNs9+EBi9e/c2X+OOGTNm2rRpjz322NNtN0UUv/XWW4uKimx+u2dLgBM4uV6q1HALHs8999wXX3xhvoD6r5syX3jhhZaf5YaLwAmcKNV/Fk67t2VWjIrvlXzDDTfMmzdv48aN+/btq6+v/6qjTXFdXbVq1axZs5Qfl5DQZ2RZh8snagRO7pYqsu3p/Hn3BG8ZlzZkUMqA/IS0QEIgtd3/hVVE8eScvspRpvI7/AIXnMCJUnUwa4XXrvTu9ukrOGiAE6VCEYrACUUo6lKc+AuiCEWd38EJRSgCJwafe4pi3wcVnFAUi4q6qQ8qOKEo5hR1Xx9UcELRVVbUk3xQwQlFV1NRD/NBBScUXU1FPcwHFZxQdDUV9TAfVHBC0VVW1JN8UMEJRVdfUY/xQQUnFMWEop7hgwpOKIoJRT3DBxWcUBQrinqADyo4oShWFPUAH1RwQlGsKOoBPqjghKJYUdQDfFDBCUWxoqgH+KCCE4piRVEP8EEFJxTFiqIe4IMKTiiKFUU9wAcVnFAUQ4q6uw8qOKEohhR1dx9UcEJRbCnq1j6o4ISi2FLUrX1QwQlFsWjc2E19UMEJRbGIUzf1QQUnFMWWom7tgwpOKIotRd3aBxWcUBRbirq1Dyo4oSiGFHV3H1RwQlHMKeq+PqjghKJuoKi7+KCCE4pQBE4MPhTFLE78BVGEos7v4IQiFIGT36Vqajp59Oj7OjL4UAROv6BUH310+PXX/9rY+IWN1NcfLC4ubH3wQKHObbyh4fjLL+9VPoMPReDUwb5+/erU1NRgMFhSUnz8+L9McPz4SmsUqXMT1GQVChUoU/lqxeBDkes4ffvtl7t2bduz51kzFzU3n87KyrRGkQ88MMeklZUNs0aROjdBXbVGkWqltqZD9aY+dcLgQ5FDOJ0/3zB27BhjFBmJhLUuEhLp6WnWKLK6usq8KxGS1WoUqaPOTVBXrVGkWqmteigvLzNGkWPGjP7++xMMPhS5gtPBg3/3GkVqFaTg8uVLjFFkfn7exx/X2ze2ffsGrZ109C6xcnKCxihSrRRRD16jSC3AGHwocgWnQ4f2e40iX331RfMePvjgn1o41dQ85H1jBw68Jpz27fuLN6gcZSrf5niNItU/gw9FDq2ddMNmHhdaWVnh/RC8oqK8sDDkjTz11Epl6uj96FyzkzK97193j8Yo8o47fsvgQ5Fzn+xpbhEkQ4feePbsKS9OgufNN1+xkapWV/Dp0++0Ec1minhxUg96qd7sfMXgQ5FzH5Rr9AuMnTu3tMNp6tTf28hNNw2uqamJRMLnzzeYiK62w0k9KOJlicGHIudwOnXq30lJibm5OadPH7M41dbWav1z4sQn5r4uOTnJGEWaO0DFdVU5Fie1VQ/qR70x+FDk9Ne4oVCBJhb7RZMgMUaRmzc/qZfvvvsPaxSpc0UUN0aRFie1bXm4R6iAwYci13EaMWL4xIkT09PT33vvkMWprq5Oayq93Lp1rTWK1LkiihujSIOTWqW3GkWqHwYfilzHacqUScYosry8TKsjg1NjY2NWVlZ9/cH586utUWRV1QxFFDdGkcpUvloZo0j1w+BDkes4rV693BpF7ty5ZfToEdYosrq6SnORNYqMRMKKWKNIZSrfGkWqHwYfilzHae/eWl+MItUPgw9FruN06NB+X4wivV9VMfhQ5ChODQ3HfTGKtB+1M/hQ5C5OTU0ng8HsThpFqoef/1yXwYciF38+uGjRg500ilQPDD4UgVPLfvLkZ3l5uVEbRaqtemDwoQicLu0rVy6L2ihSbRl8KAKny/vhwweiNopUWwYfisDp8t7cfDpqo0jzrAgGH4rAqQ1O0RlFghOKwKnN/vbbf4vaKFJtGXwoAqc2z36I2iiy3bMlGHwoch2n8vKyqI0i1ZbBhyJwurSfP99QVTUjEEiNwigyKSlx+vQ7O1w+MfhQ5O5DlU+fPrZ3b+2iRQ9OmDB2yJBBwWB2VlZmu/8Lq4jihYUh5ShT+R1+gcvgQxGP/O9g1jp69H3vbp++wuBDETgx+FAETpQKRT0DJ/6CKEJR53dwQhGKwInBh6IuUxS1sys4ochpRf46u4ITitxV5LuzKzihyBVFV8DZFZxQ5ISiK+PsCk4ockLRlXF2BScUOaHoyji7ghOKXFF0BZxdwQlFDinqamdXcEKRW4q61NkVnFDklqIudXYFJxQ5p6jrnF3BCUXOKeo6Z1dwQpFzirrO2RWcUOScoq5zdgUnFDmnqOucXcEJRc4p6jpnV3BCkXOKus7ZFZxQ5JyirnN2BScUuaioi5xdwQlFLirqImdXcEKRo4q6wtkVnFDkqKKucHYFJxQ5qqgrnF3BCUVO4+Svsys4ochRRV3h7ApOKHJUUVc4u4ITihxV1BXOruCEIhcVdZGzKzihyF1Fvju7ghOKUNRm1uqMsys4oQhF+Dsx+FAUszjxF0QRijq/gxOKUOQMTgN3bA6vXakjpUIROP0CYcWrl1+7eH5k+3obKVyxNLlfTlxcnI46t/HIM+sKHp6nfAYfisCpgz13xpSklJRgMJic269k3SoTDAwutbaKOjdBTVZJfbOVqXy1YvChyHWcBj63of+cWf3nzjZzUemurQmBVGurmD3uNyatd2HI2irq3AR11doqqpXaXupw7mz1qRMGH4ocwql097bAoIHGVrFXXq7WRUIiPiXF2ipmVVaYNydCMlttFXXUuQnqqrVVVCu1VQ+p4SJjqxgYWDKwdhODD0Wu4BRaushrq6hVkII5k24ztopJWZnFa/5k319eq9OOjt4lVmJ6mrFVVCtF1IPXVlELMAYfilzB6bpli722igUL/mDeStETj2nhFLx1vPf9hZYsEE4FC+/3BpWjTOXbHK+tovpn8KHIobWTbtjMwzUDpRHvh+CpkXByTl9vJHfaZGXq6P3oXLOTMr0ydPdobBXTf/0rBh+KnPtkT3OLIEkJFZT+eYsXpxbbnEcetpHMilGK9BlZZiOazRTx4qQe9FK92fmKwYci5z4o1+gXGP3vndkOp4wRw20k5doBNTU1vfJyS3dvMxFdbYeTelDEyxKDD0XO4XT91rVxCQmJGRmRbU9bnGpra1MCges3rTH3dfGJicZW0dwBKq6ryrE4qa16UD/qjcGHIqe/xk3qm62JxX7RJEiMreI1M6e2fGjx+CPWVlHniihubBUtTmqrHtQPgw9FruPUu7hw4sSJaenpRSuXWZzq6uq0pmqBZ9Y0a6uo85Z7v1CBsVU0OKlVWqutovph8KHIdZwybh5mbBVTw0VaHRmcGhsbMzIzC1cszR5faW0VMytGKaK4sVVUZkt+uMjYKqofBh+KXMep35RJ1lax/70zU0uKra1iVmWF5iJrq9grL1cRa6uoTOVbW0X1w+BDkes45c+7xxdbRfXD4EOR6zhdt2yxL7aK3q+qGHwochSnyDPrfLFVtB+1M/hQ5C5OA3dsTkgLdNJWUT38/Oe6DD4UufjzweAt4zppq6geGHwoAqfW/xux5cnEzD5R2yqqrXpg8KEInC7tOZN/F7Wtotoy+FAETpf3wuV/jNpWUW0ZfCgCp8t76a6tUdsqmmdFMPhQBE5tcIrOVhGcUARObfbQowujtlVUWwYfisCpzbMforZVbPdsCQYfilzHKTVcFLWtotoy+FAETv9ZOO3ellkxKr5XchS2inEJCX1GlnW4fGLwocjdhypHtj2dP++e4C3j0oYMShmQn5AWSAiktvu/sIoonpzTVznKVH6HX+Ay+FDEI/87mLXCa1d6d/v0FQYfisCJUqEInCgVilD0i3DiL4giFHV+BycUoQicGHz/bccHFZwoVTSK8EEFJ0rljyJ8UMGJUkWpCB9UcAInfxThgwpO4OSbInxQwQmcfFOEDyo4gZOfivBBBSdw8lMRPqjgRKn8VIQPKjhRKt8U4YMKTpTKT0X4oIITpfJNET6o4ESpfFOEDyo4USrfFOGDCk6UyjdF+KCCE6XyTRE+qOBEqXxThA8qOFEq3xThgwpOlMpPRfigghOl8k0RPqjgRKn8VIQPKjhRKt8U4YMKTpTKN0X4oIITpfIZJ3xQwYlS+aAIH1RwolS+KcIHFZwolW+K8EEFJ0rljyJ8UMGJUvmsCB9UcKJUXagIH1RwolQoAidKhSIUtcOJvyCKUNT5HZxQhKKrjVNT08mjR9/XkVKhCEW/AKePPjr8+ut/bWz8wkbq6w8WFxe2PnigUOc23tBw/OWX9yqfUqEInDrY169fnZqaGgwGS0qKjx//lwmOH19pjSJ1boKarEKhAmUqX60oFYpcx+nbb7/ctWvbnj3Pmrmoufl0VlamNYp84IE5Jq2sbJg1itS5CeqqNYpUK7U1Hao39akTSoUih3A6f75h7NgxxigyEglrXSQk0tPTrFFkdXWVeXMiJKvVKFJHnZugrlqjSLVSW/VQXl5mjCLHjBn9/fcnKBWKXMHp4MG/e40itQpScPnyJcYoMj8/7+OP6+372759g9ZOOnqXWDk5QWMUqVaKqAevUaQWYJQKRa7gdOjQfq9R5Kuvvmjeygcf/FMLp5qah7zv78CB14TTvn1/8QaVo0zl2xyvUaT6p1QocmjtpBs287jQysoK74fgFRXlhYUhb+Spp1YqU0fvR+eanZTplaG7R2MUeccdv6VUKHLukz3NLYJk6NAbz5495cVJ8Lz55is2UtXqCj59+p02otlMES9O6kEv1ZudrygVipz7oFyjX2Ds3LmlHU5Tp/7eRm66aXBNTU0kEj5/vsFEdLUdTupBES9LlApFzuF06tS/k5ISc3NzTp8+ZnGqra3V+ufEiU/MfV1ycpIxijR3gIrrqnIsTmqrHtSPeqNUKHL6a9xQqEATi/2iSZAYo8jNm5/Uy3ff/Yc1itS5Ioobo0iLk9q2PNwjVECpUOQ6TiNGDJ84cWJ6evp77x2yONXV1WlNpZdbt661RpE6V0RxYxRpcFKr9FajSPVDqVDkOk5TpkwyRpHl5WVaHRmcGhsbs7Ky6usPzp9fbY0iq6pmKKK4MYpUpvLVyhhFqh9KhSLXcVq9erk1ity5c8vo0SOsUWR1dZXmImsUGYmEFbFGkcpUvjWKVD+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,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\",\"relationship\":null}],\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"target\":\"/matlab/document.xml\",\"relationshipId\":\"rId1\"}]}"},{"id":44376,"title":"The sliding puzzle: 3D","description":"This is an extension of problem 42842. In this case, the puzzle is three-dimensional and is of size 3x3x3. Of the 27 positions in the puzzle, 26 are occupied by cubes numbered 1 thru 26, while the remaining position is empty. You can slide an adjacent cube into the empty position, similarly to sliding an adjacent tile into the empty position in the 15 puzzle.\r\nIn this case, for simplicity, the puzzle is represented by a vectorized form of the puzzle, such that the 3D form of the puzzle can be obtained by reshape(p,[3 3 3]). Therefore, a solved cube shall look like this:\r\n p = [1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;0]\r\nGiven the initial state vector, p, return a vector, m, comprising a sequence of integers, representing the linear indices of the cubes you wish to slide, in turn, into the empty position, in order to solve the puzzle.\r\nAs before, the solution does not have to be efficient. It must simply result in a correctly solved puzzle. Illegal moves, such as trying to slide a tile that is not adjacent to the open slot, will be ignored.\r\nExample:\r\n p = [0;2;3;1;5;6;4;7;9;10;11;12;13;17;14;16;8;18;19;20;21;22;23;15;25;26;24]\r\n\r\n m = [4 7 8 17 14 15 24 27]","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 348.75px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 174.375px; transform-origin: 407px 174.375px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThis is an extension of\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003ca target='_blank' href = \"https://www.mathworks.com/matlabcentral/cody/problems/42842\"\u003e\u003cspan style=\"\"\u003e\u003cspan style=\"\"\u003eproblem 42842\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. In this case, the puzzle is three-dimensional and is of size 3x3x3. Of the 27 positions in the puzzle, 26 are occupied by cubes numbered 1 thru 26, while the remaining position is empty. You can slide an adjacent cube into the empty position, similarly to sliding an adjacent tile into the empty position in the 15 puzzle.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIn this case, for simplicity, the puzzle is represented by a vectorized form of the puzzle, such that the 3D form of the puzzle can be obtained by\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003ereshape(p,[3 3 3])\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e. Therefore, a solved cube shall look like this:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 20.4375px; 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 10.2188px; transform-origin: 404px 10.2188px; margin-left: 3px; margin-top: 10px; margin-bottom: 10px; margin-right: 3px; \"\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-end-end-radius: 0px; border-end-start-radius: 0px; border-inline-end-color: rgb(233, 233, 233); border-inline-end-style: solid; border-inline-end-width: 1px; border-inline-start-color: rgb(233, 233, 233); border-inline-start-style: solid; border-inline-start-width: 1px; border-left-color: rgb(233, 233, 233); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(233, 233, 233); border-right-style: solid; border-right-width: 1px; border-start-end-radius: 0px; border-start-start-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-block-size: 18px; min-height: 18px; padding-inline-start: 4px; padding-left: 4px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e p = [1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;0]\u003c/span\u003e\u003c/span\u003e\u003c/div\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: 10px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 10px; perspective-origin: 384px 21px; text-align: left; transform-origin: 384px 21px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven the initial state vector, p, return a vector, m, comprising a sequence of integers, representing the linear indices of the cubes you wish to slide, in turn, into the empty position, in order to solve the puzzle.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eAs before, the solution does not have to be efficient. It must simply result in a correctly solved puzzle. Illegal moves, such as trying to slide a tile that is not adjacent to the open slot, will be ignored.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eExample:\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 61.3125px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 4px; border-start-end-radius: 4px; border-start-start-radius: 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; margin-block-end: 10px; margin-block-start: 10px; margin-bottom: 10px; margin-inline-end: 3px; margin-inline-start: 3px; margin-left: 3px; margin-right: 3px; margin-top: 10px; perspective-origin: 404px 30.6562px; transform-origin: 404px 30.6562px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e p = [0;2;3;1;5;6;4;7;9;10;11;12;13;17;14;16;8;18;19;20;21;22;23;15;25;26;24]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e m = [4 7 8 17 14 15 24 27]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function m = sliding3d(p)\r\n  m = -1;\r\nend","test_suite":"%%\r\nfiletext = fileread('sliding3d.m');\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'assign')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'freepass')))\r\n\r\n%%\r\np = [0;2;3;1;5;6;4;7;9;10;11;12;13;17;14;16;8;18;19;20;21;22;23;15;25;26;24];\r\nm = sliding3d(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero=find(p == 0);\r\n    [a0 b0 c0] = ind2sub([3 3 3],zero);\r\n    [a1 b1 c1] = ind2sub([3 3 3],m(i));\r\n    if abs(a1 - a0) + abs(b1 - b0) + abs(c1 - c0) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;0]))\r\n\r\n%%\r\np = [1;0;2;4;8;5;7;9;18;10;21;12;11;14;15;16;17;6;13;3;19;20;22;24;25;23;26];\r\nm = sliding3d(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero=find(p == 0);\r\n    [a0 b0 c0] = ind2sub([3 3 3],zero);\r\n    [a1 b1 c1] = ind2sub([3 3 3],m(i));\r\n    if abs(a1 - a0) + abs(b1 - b0) + abs(c1 - c0) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;0]))\r\n\r\n%%\r\np = [1;4;3;19;10;6;7;2;9;20;11;0;16;14;12;5;13;18;22;23;21;17;15;24;25;8;26];\r\nm = sliding3d(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero=find(p == 0);\r\n    [a0 b0 c0] = ind2sub([3 3 3],zero);\r\n    [a1 b1 c1] = ind2sub([3 3 3],m(i));\r\n    if abs(a1 - a0) + abs(b1 - b0) + abs(c1 - c0) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;0]))\r\n\r\n%%\r\np = [1;5;3;10;7;0;13;9;24;22;2;15;16;11;17;12;8;6;19;20;21;26;14;23;4;25;18];\r\nm = sliding3d(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero=find(p == 0);\r\n    [a0 b0 c0] = ind2sub([3 3 3],zero);\r\n    [a1 b1 c1] = ind2sub([3 3 3],m(i));\r\n    if abs(a1 - a0) + abs(b1 - b0) + abs(c1 - c0) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;0]))\r\n","published":true,"deleted":false,"likes_count":14,"comments_count":9,"created_by":15521,"edited_by":15521,"edited_at":"2022-11-18T05:31:46.000Z","deleted_by":null,"deleted_at":null,"solvers_count":53,"test_suite_updated_at":"2022-11-18T05:31:46.000Z","rescore_all_solutions":false,"group_id":35,"created_at":"2017-10-11T12:38:57.000Z","updated_at":"2026-02-03T07:53:47.000Z","published_at":"2017-10-16T01:51:01.000Z","restored_at":null,"restored_by":null,"spam":null,"simulink":false,"admin_reviewed":false,"description_opc":"{\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis is an extension of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"https://www.mathworks.com/matlabcentral/cody/problems/42842\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eproblem 42842\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. In this case, the puzzle is three-dimensional and is of size 3x3x3. Of the 27 positions in the puzzle, 26 are occupied by cubes numbered 1 thru 26, while the remaining position is empty. You can slide an adjacent cube into the empty position, similarly to sliding an adjacent tile into the empty position in the 15 puzzle.\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 this case, for simplicity, the puzzle is represented by a vectorized form of the puzzle, such that the 3D form of the puzzle can be obtained by\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003ereshape(p,[3 3 3])\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e. Therefore, a solved cube shall look like this:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ p = [1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20;21;22;23;24;25;26;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\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven the initial state vector, p, return a vector, m, comprising a sequence of integers, representing the linear indices of the cubes you wish to slide, in turn, into the empty position, in order to solve the puzzle.\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\u003eAs before, the solution does not have to be efficient. It must simply result in a correctly solved puzzle. Illegal moves, such as trying to slide a tile that is not adjacent to the open slot, will be ignored.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[ p = [0;2;3;1;5;6;4;7;9;10;11;12;13;17;14;16;8;18;19;20;21;22;23;15;25;26;24]\\n\\n m = [4 7 8 17 14 15 24 27]]]\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":1934,"title":"GJam 2014 China Rd B: Sudoku Checker","description":"This Challenge is derived from \u003chttp://code.google.com/codejam/contest/2929486/dashboard#s=p0 GJam 2014 China Sudoku\u003e. Large Case.\r\n\r\nThe Goal is determine if the Sudoku square is valid. Each row and column  must contain 1:N, for an NxN matix. Nroot=N^.5. Each NrootxNroot block must contain 1:N where blocks start at [1,1+Nroot,...] in Row/Col.\r\n\r\n\r\n*Input:* [M], NxN matrix (3^2\u003c=N\u003c=6^2)\r\n\r\n*Output:* TF, 1=Valid, 0=Invalid\r\n\r\n*Examples:*\r\n\r\n  TF=1\r\n  5 3 4 6 7 8 9 1 2\r\n  6 7 2 1 9 5 3 4 8\r\n  1 9 8 3 4 2 5 6 7\r\n  8 5 9 7 6 1 4 2 3\r\n  4 2 6 8 5 3 7 9 1\r\n  7 1 3 9 2 4 8 5 6\r\n  9 6 1 5 3 7 2 8 4\r\n  2 8 7 4 1 9 6 3 5\r\n  3 4 5 2 8 6 1 7 9\r\n  \r\n  TF=0\r\n  5 3 4 6 7 8 9 1 2\r\n  6 7 2 1 9 5 3 4 8\r\n  1 9 8 3 4 2 5 6 7\r\n  8 5 9 7 6 1 4 2 3\r\n  4 2 6 8 999 3 7 9 1\r\n  7 1 3 9 2 4 8 5 6\r\n  9 6 1 5 3 7 2 8 4\r\n  2 8 7 4 1 9 6 3 5\r\n  3 4 5 2 8 6 1 7 9\r\n\r\n\r\n*Contest Performance:* Best Delta Time of 7 minutes with 1146 of 2010 able to process the large data set.\r\n","description_html":"\u003cp\u003eThis Challenge is derived from \u003ca href = \"http://code.google.com/codejam/contest/2929486/dashboard#s=p0\"\u003eGJam 2014 China Sudoku\u003c/a\u003e. Large Case.\u003c/p\u003e\u003cp\u003eThe Goal is determine if the Sudoku square is valid. Each row and column  must contain 1:N, for an NxN matix. Nroot=N^.5. Each NrootxNroot block must contain 1:N where blocks start at [1,1+Nroot,...] in Row/Col.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e [M], NxN matrix (3^2\u0026lt;=N\u0026lt;=6^2)\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e TF, 1=Valid, 0=Invalid\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003eTF=1\r\n5 3 4 6 7 8 9 1 2\r\n6 7 2 1 9 5 3 4 8\r\n1 9 8 3 4 2 5 6 7\r\n8 5 9 7 6 1 4 2 3\r\n4 2 6 8 5 3 7 9 1\r\n7 1 3 9 2 4 8 5 6\r\n9 6 1 5 3 7 2 8 4\r\n2 8 7 4 1 9 6 3 5\r\n3 4 5 2 8 6 1 7 9\r\n\u003c/pre\u003e\u003cpre class=\"language-matlab\"\u003eTF=0\r\n5 3 4 6 7 8 9 1 2\r\n6 7 2 1 9 5 3 4 8\r\n1 9 8 3 4 2 5 6 7\r\n8 5 9 7 6 1 4 2 3\r\n4 2 6 8 999 3 7 9 1\r\n7 1 3 9 2 4 8 5 6\r\n9 6 1 5 3 7 2 8 4\r\n2 8 7 4 1 9 6 3 5\r\n3 4 5 2 8 6 1 7 9\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eContest Performance:\u003c/b\u003e Best Delta Time of 7 minutes with 1146 of 2010 able to process the large data set.\u003c/p\u003e","function_template":"function TF=Sudoku_CH(m)\r\n TF=0;\r\nend","test_suite":"%%\r\nzm=[13 4 3 6 1 8 7 10 5 12 11 14 9 16 15 2 ;2 5 8 7 6 9 12 11 10 13 16 15 14 1 4 3 ;15 14 1 12 3 2 5 16 7 6 9 4 11 10 13 8 ;16 11 10 9 4 15 14 13 8 3 2 1 12 7 6 5 ;1 8 7 10 5 12 11 14 9 16 15 2 13 4 3 6 ;6 9 12 11 10 13 16 15 14 1 4 3 2 5 8 7 ;3 2 5 16 7 6 9 4 11 10 13 8 15 14 1 12 ;4 15 14 13 8 3 2 1 12 7 6 5 16 11 10 9 ;5 12 11 14 9 16 15 2 13 4 3 6 1 8 7 10 ;10 13 16 15 14 1 4 3 2 5 8 7 6 9 12 11 ;7 6 9 4 11 10 13 8 15 14 1 12 3 2 5 16 ;8 3 2 1 12 7 6 5 16 11 10 9 4 15 14 13 ;9 16 15 2 13 4 3 6 1 8 7 10 5 12 11 14 ;14 1 4 3 2 5 8 7 6 9 12 11 10 13 16 15 ;11 10 13 8 15 14 1 12 3 2 5 16 7 6 9 4 ;12 7 6 5 16 11 10 9 4 15 14 13 8 3 2 1 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[7 36 5 16 33 32 13 6 11 22 3 2 19 12 17 28 9 8 25 18 23 34 15 14 31 24 29 4 21 20 1 30 35 10 27 26 ;20 25 30 17 10 3 26 31 36 23 16 9 32 1 6 29 22 15 2 7 12 35 28 21 8 13 18 5 34 27 14 19 24 11 4 33 ;27 26 13 24 11 4 33 32 19 30 17 10 3 2 25 36 23 16 9 8 31 6 29 22 15 14 1 12 35 28 21 20 7 18 5 34 ;34 9 8 19 18 29 4 15 14 25 24 35 10 21 20 31 30 5 16 27 26 1 36 11 22 33 32 7 6 17 28 3 2 13 12 23 ;35 22 15 14 31 6 5 28 21 20 1 12 11 34 27 26 7 18 17 4 33 32 13 24 23 10 3 2 19 30 29 16 9 8 25 36 ;12 23 28 21 2 1 18 29 34 27 8 7 24 35 4 33 14 13 30 5 10 3 20 19 36 11 16 9 26 25 6 17 22 15 32 31 ;13 6 11 22 3 2 19 12 17 28 9 8 25 18 23 34 15 14 31 24 29 4 21 20 1 30 35 10 27 26 7 36 5 16 33 32 ;26 31 36 23 16 9 32 1 6 29 22 15 2 7 12 35 28 21 8 13 18 5 34 27 14 19 24 11 4 33 20 25 30 17 10 3 ;33 32 19 30 17 10 3 2 25 36 23 16 9 8 31 6 29 22 15 14 1 12 35 28 21 20 7 18 5 34 27 26 13 24 11 4 ;4 15 14 25 24 35 10 21 20 31 30 5 16 27 26 1 36 11 22 33 32 7 6 17 28 3 2 13 12 23 34 9 8 19 18 29 ;5 28 21 20 1 12 11 34 27 26 7 18 17 4 33 32 13 24 23 10 3 2 19 30 29 16 9 8 25 36 35 22 15 14 31 6 ;18 29 34 27 8 7 24 35 4 33 14 13 30 5 10 3 20 19 36 11 16 9 26 25 6 17 22 15 32 31 12 23 28 21 2 1 ;19 12 17 28 9 8 25 18 23 34 15 14 31 24 29 4 21 20 1 30 35 10 27 26 7 36 5 16 33 32 13 6 11 22 3 2 ;32 1 6 29 22 15 2 7 12 35 28 21 8 13 18 5 34 27 14 19 24 11 4 33 20 25 30 17 10 3 26 31 36 23 16 9 ;3 2 25 36 23 16 9 8 31 6 29 22 15 14 1 12 35 28 21 20 7 18 5 34 28 26 13 24 11 4 33 32 19 30 17 10 ;10 21 20 31 30 5 16 27 26 1 36 11 22 33 32 7 6 17 28 3 2 13 12 23 34 9 8 19 18 29 4 15 14 25 24 35 ;11 34 27 26 7 18 17 4 33 32 13 24 23 10 3 2 19 30 29 16 9 8 25 36 35 22 15 14 31 6 5 28 21 20 1 12 ;24 35 4 33 14 13 30 5 10 3 20 19 36 11 16 9 26 25 6 17 22 15 32 31 12 23 28 21 2 1 18 29 34 27 8 7 ;25 18 23 34 15 14 31 24 29 4 21 20 1 30 35 10 27 26 7 36 5 16 33 32 13 6 11 22 3 2 19 12 17 28 9 8 ;2 7 12 35 28 21 8 13 18 5 34 27 14 19 24 11 4 33 20 25 30 17 10 3 26 31 36 23 16 9 32 1 6 29 22 15 ;9 8 31 6 29 22 15 14 1 12 35 28 21 20 7 18 5 34 27 26 13 24 11 4 33 32 19 30 17 10 3 2 25 36 23 16 ;16 27 26 1 36 11 22 33 32 7 6 17 28 3 2 13 12 23 34 9 8 19 18 29 4 15 14 25 24 35 10 21 20 31 30 5 ;17 4 33 32 13 24 23 10 3 2 19 30 29 16 9 8 25 36 35 22 15 14 31 6 5 28 21 20 1 12 11 34 27 26 7 18 ;30 5 10 3 20 19 36 11 16 9 26 25 6 17 22 15 32 31 12 23 28 21 2 1 18 29 34 27 8 7 24 35 4 33 14 13 ;31 24 29 4 21 20 1 30 35 10 27 26 7 36 5 16 33 32 13 6 11 22 3 2 19 12 17 28 9 8 25 18 23 34 15 14 ;8 13 18 5 34 27 14 19 24 11 4 33 20 25 30 17 10 3 26 31 36 23 16 9 32 1 6 29 22 15 2 7 12 35 28 21 ;15 14 1 12 35 28 21 20 7 18 5 34 27 26 13 24 11 4 33 32 19 30 17 10 3 2 25 36 23 16 9 8 31 6 29 22 ;22 33 32 7 6 17 28 3 2 13 12 23 34 9 8 19 18 29 4 15 14 25 24 35 10 21 20 31 30 5 16 27 26 1 36 11 ;23 10 3 2 19 30 29 16 9 8 25 36 35 22 15 14 31 6 5 28 21 20 1 12 11 34 27 26 7 18 17 4 33 32 13 24 ;36 11 16 9 26 25 6 17 22 15 32 31 12 23 28 21 2 1 18 29 34 27 8 7 24 35 4 33 14 13 30 5 10 3 20 19 ;1 30 35 10 27 26 7 36 5 16 33 32 13 6 11 22 3 2 19 12 17 28 9 8 25 18 23 34 15 14 31 24 29 4 21 20 ;14 19 24 11 4 33 20 25 30 17 10 3 26 31 36 23 16 9 32 1 6 29 22 15 2 7 12 35 28 21 8 13 18 5 34 27 ;21 20 7 18 5 34 27 26 13 24 11 4 33 32 19 30 17 10 3 2 25 36 23 16 9 8 31 6 29 22 15 14 1 12 35 28 ;28 3 2 13 12 23 34 9 8 19 18 29 4 15 14 25 24 35 10 21 20 31 30 5 16 27 26 1 36 11 22 33 32 7 6 17 ;29 16 9 8 25 36 35 22 15 14 31 6 5 28 21 20 1 12 11 34 27 26 7 18 17 4 33 32 13 24 23 10 3 2 19 30 ;6 17 22 15 32 31 12 23 28 21 2 1 18 29 34 27 8 7 24 35 4 33 14 13 30 5 10 3 20 19 36 11 16 9 26 25 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[5 8 7 10 9 12 11 14 13 16 15 2 1 4 3 6 ;14 13 13 11 2 1 16 15 6 5 4 3 10 9 8 7 ;3 6 1 4 7 10 5 8 11 14 9 12 15 2 13 16 ;16 15 2 9 4 3 6 13 8 7 10 1 12 11 14 5 ;9 12 11 14 13 16 15 2 1 4 3 6 5 8 7 10 ;2 1 16 15 6 5 4 3 10 9 8 7 14 13 12 11 ;7 10 5 8 11 14 9 12 15 2 13 16 3 6 1 4 ;4 3 6 13 8 7 10 1 12 11 14 5 16 15 2 9 ;13 16 15 2 1 4 3 6 5 8 7 10 9 12 11 14 ;6 5 4 3 10 9 8 7 14 13 12 11 2 1 16 15 ;11 14 9 12 15 2 13 16 3 6 1 4 7 10 5 8 ;8 7 10 1 12 11 14 5 16 15 2 9 4 3 6 13 ;1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 2 ;10 9 8 7 14 13 12 11 2 1 16 15 6 5 4 3 ;15 2 13 16 3 6 1 4 7 10 5 8 11 14 9 12 ;12 11 14 5 16 15 2 9 4 3 6 13 8 7 10 1 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[5 12 3 14 9 16 7 2 13 4 11 6 1 8 15 10 ;6 9 4 11 10 13 8 16 14 1 12 3 2 5 16 7 ;7 10 1 16 11 14 5 4 15 2 9 8 3 6 13 12 ;8 15 2 13 12 3 6 1 16 7 10 5 4 11 14 9 ;9 16 7 2 13 4 11 6 1 8 15 10 5 12 3 14 ;10 13 8 15 14 1 12 3 2 5 16 7 6 9 4 11 ;11 14 5 4 15 2 9 8 3 6 13 12 7 10 1 16 ;12 3 6 1 16 7 10 5 4 11 14 9 8 15 2 13 ;13 4 11 6 1 8 15 10 5 12 3 14 9 16 7 2 ;14 1 12 3 2 5 16 7 6 9 4 11 10 13 8 15 ;15 2 9 8 3 6 13 12 7 10 1 16 11 14 5 4 ;16 7 10 5 4 11 14 9 8 15 2 13 12 3 6 1 ;1 8 15 10 5 12 3 14 9 16 7 2 13 4 11 6 ;2 5 16 7 6 9 4 11 10 13 8 15 14 1 12 3 ;3 6 13 12 7 10 1 16 11 14 5 4 15 2 9 8 ;4 11 14 9 8 15 2 13 12 3 6 1 16 7 10 5 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 3 8 4 6 2 7 9 5 ;2 7 6 5 1 9 8 4 3 ;9 5 4 3 8 7 6 2 1 ;4 6 2 7 9 5 1 3 8 ;5 1 9 8 4 3 2 7 6 ;3 8 7 6 2 1 9 5 4 ;7 9 5 1 3 8 4 6 2 ;8 4 3 2 7 6 5 1 9 ;6 2 1 9 5 4 3 8 7 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[31 36 11 22 33 20 1 6 17 28 3 26 7 12 23 34 9 32 13 18 29 4 15 2 19 24 35 10 21 8 25 30 5 16 27 14 ;14 25 6 29 34 15 20 31 12 35 4 21 26 1 18 5 10 27 32 7 24 11 16 33 2 13 30 17 22 3 8 19 36 23 28 9 ;3 2 13 12 5 28 9 8 19 18 11 34 15 14 25 24 17 4 21 20 31 30 23 10 27 26 1 36 29 16 33 32 7 6 35 22 ;16 9 26 1 24 17 22 15 32 7 30 23 28 21 2 13 36 29 34 27 8 19 6 35 4 33 14 25 12 5 10 3 20 31 18 11 ;23 4 21 8 19 18 29 10 27 14 25 24 35 16 33 20 31 30 5 22 3 26 1 36 11 28 9 32 7 6 17 34 15 2 13 12 ;30 35 10 27 32 7 36 5 16 33 2 13 6 11 22 3 8 19 12 17 28 9 14 25 18 23 34 15 20 31 24 29 4 21 26 1 ;1 6 17 28 3 26 7 12 23 34 9 32 13 18 29 4 15 2 19 24 35 10 21 8 25 30 5 16 27 14 31 36 11 22 33 20 ;20 31 12 35 4 21 26 1 18 5 10 27 32 7 24 11 16 33 2 13 30 17 22 3 8 19 36 23 28 9 14 25 6 29 34 15 ;9 8 19 18 11 34 15 14 25 24 17 4 21 20 31 30 23 10 27 26 1 36 29 16 33 32 7 6 35 22 3 2 13 12 5 28 ;22 15 32 7 30 23 28 21 2 13 36 29 34 27 8 19 6 35 4 33 14 25 12 5 10 3 20 31 18 11 16 9 26 1 24 17 ;29 10 27 14 25 24 35 16 33 20 31 30 5 22 3 26 1 36 11 28 9 32 7 6 17 34 15 2 13 12 23 4 21 8 19 18 ;36 5 16 33 2 13 6 11 22 3 8 19 12 17 28 9 14 25 18 23 34 15 20 31 24 29 4 21 26 1 30 35 10 27 32 7 ;7 12 23 34 9 32 13 18 29 4 15 2 19 24 35 10 21 8 25 30 5 16 27 14 31 36 11 22 33 20 1 6 17 28 3 26 ;26 1 18 5 10 27 32 7 24 11 16 33 2 13 30 17 22 3 8 19 36 23 29 9 14 25 6 29 34 15 20 31 12 35 4 21 ;15 14 25 24 17 4 21 20 31 30 23 10 27 26 1 36 29 16 33 32 7 6 35 22 3 2 13 12 5 28 9 8 19 18 11 34 ;28 21 2 13 36 29 34 27 8 19 6 35 4 33 14 25 12 5 10 3 20 31 18 11 16 9 26 1 24 17 22 15 32 7 30 23 ;35 16 33 20 31 30 5 22 3 26 1 36 11 28 9 32 7 6 17 34 15 2 13 12 23 4 21 8 19 18 29 10 27 14 25 24 ;6 11 22 3 8 19 12 17 28 9 14 25 18 23 34 15 20 31 24 29 4 21 26 1 30 35 10 27 32 7 36 5 16 33 2 13 ;13 18 29 4 15 2 19 24 35 10 21 8 25 30 5 16 27 14 31 36 11 22 33 20 1 6 17 28 3 26 7 12 23 34 9 32 ;32 7 24 11 16 33 2 13 30 17 22 3 8 19 36 23 28 9 14 25 6 29 34 15 20 31 12 35 4 21 26 1 18 5 10 27 ;21 20 31 30 23 10 27 26 1 36 29 16 33 32 7 6 35 22 3 2 13 12 5 28 9 8 19 18 11 34 15 14 25 24 17 4 ;34 27 8 19 6 35 4 33 14 25 12 5 10 3 20 31 18 11 16 9 26 1 24 17 22 15 32 7 30 23 28 21 2 13 36 29 ;5 22 3 26 1 36 11 28 9 32 7 6 17 34 15 2 13 12 23 4 21 8 19 18 29 10 27 14 25 24 35 16 33 20 31 30 ;12 17 28 9 14 25 18 23 34 15 20 31 24 29 4 21 26 1 30 35 10 27 32 7 36 5 16 33 2 13 6 11 22 3 8 19 ;19 24 35 10 21 8 25 30 5 16 27 14 31 36 11 22 33 20 1 6 17 28 3 26 7 12 23 34 9 32 13 18 29 4 15 2 ;2 13 30 17 22 3 8 19 36 23 28 9 14 25 6 29 34 15 20 31 12 35 4 21 26 1 18 5 10 27 32 7 24 11 16 33 ;27 26 1 36 29 16 33 32 7 6 35 22 3 2 13 12 5 28 9 8 19 18 11 34 15 14 25 24 17 4 21 20 31 30 23 10 ;4 33 14 25 12 5 10 3 20 31 18 11 16 9 26 1 24 17 22 15 32 7 30 23 28 21 2 13 36 29 34 27 8 19 6 35 ;11 28 9 32 7 6 17 34 15 2 13 12 23 4 21 8 19 18 29 10 27 14 25 24 35 16 33 20 31 30 5 22 3 26 1 36 ;18 23 34 15 20 31 24 29 4 21 26 1 30 35 10 27 32 7 36 5 16 33 2 13 6 11 22 3 8 19 12 17 28 9 14 25 ;25 30 5 16 27 14 31 36 11 22 33 20 1 6 17 28 3 26 7 12 23 34 9 32 13 18 29 4 15 2 19 24 35 10 21 8 ;8 19 36 23 28 9 14 25 6 29 34 15 20 31 12 35 4 21 26 1 18 5 10 27 32 7 24 11 16 33 2 13 30 17 22 3 ;33 32 7 6 35 22 3 2 13 12 5 28 9 8 19 18 11 34 15 14 25 24 17 4 21 20 31 30 23 10 27 26 1 36 29 16 ;10 3 20 31 18 11 16 9 26 1 24 17 22 15 32 7 30 23 28 21 2 13 36 29 34 27 8 19 6 35 4 33 14 25 12 5 ;17 34 15 2 13 12 23 4 21 8 19 18 29 10 27 14 25 24 35 16 33 20 31 30 5 22 3 26 1 36 11 28 9 32 7 6 ;24 29 4 21 26 1 30 35 10 27 32 7 36 5 16 33 2 13 6 11 22 3 8 19 12 17 28 9 14 25 18 23 34 15 20 31 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 12 7 14 5 16 11 2 9 4 15 6 13 8 3 10 ;10 13 16 3 14 2 4 7 2 5 8 11 6 9 12 15 ;15 2 5 8 3 6 9 12 7 10 13 16 11 14 1 4 ;4 11 6 9 8 15 10 13 12 3 14 1 16 7 2 5 ;5 16 11 2 9 4 15 6 13 8 3 10 1 12 7 14 ;14 1 4 7 2 5 8 11 6 9 12 15 10 13 16 3 ;3 6 9 12 7 10 13 16 11 14 1 4 15 2 5 8 ;8 15 10 13 12 3 14 1 16 7 2 5 4 11 6 9 ;9 4 15 6 13 8 3 10 1 12 7 14 5 16 11 2 ;2 5 8 11 6 9 12 15 10 13 16 3 14 1 4 7 ;7 10 13 16 11 14 1 4 15 2 5 8 3 6 9 12 ;12 3 14 1 16 7 2 5 4 11 6 9 8 15 10 13 ;13 8 3 10 1 12 7 14 5 16 11 2 9 4 15 6 ;6 9 12 15 10 13 16 3 14 1 4 7 2 5 8 11 ;11 14 1 4 15 2 5 8 3 6 9 12 7 10 13 16 ;16 7 2 5 4 11 6 9 8 15 10 13 12 3 14 1 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[7 6 17 16 9 20 13 12 23 22 15 26 19 18 29 28 21 32 25 24 35 34 27 2 31 30 5 4 33 8 1 36 11 10 3 14 ;26 25 12 29 34 15 32 31 18 35 4 21 2 1 24 5 10 27 8 7 30 11 16 33 14 13 36 17 22 3 20 19 6 23 28 9 ;27 14 13 36 23 28 33 20 19 6 29 34 3 26 25 12 35 4 9 32 31 18 5 10 15 2 1 24 11 16 21 8 7 30 17 22 ;22 33 2 1 18 11 28 3 8 7 24 17 34 9 14 13 30 23 4 15 20 19 36 29 10 21 26 25 6 35 16 27 32 31 12 5 ;5 10 3 8 31 30 11 16 9 14 1 36 17 22 15 20 7 6 23 28 21 26 13 12 29 34 27 32 19 18 35 4 33 2 25 24 ;24 35 4 21 32 19 30 5 10 27 2 25 36 11 16 33 8 31 6 17 22 3 14 1 12 23 28 9 20 7 18 29 34 15 26 13 ;13 12 23 22 15 26 19 18 29 28 21 32 25 24 35 34 27 2 31 30 5 4 33 8 1 36 11 10 3 14 7 6 17 16 9 20 ;32 31 18 35 4 21 2 1 24 5 10 27 8 7 30 11 16 33 14 13 36 17 22 3 20 19 6 23 28 9 26 25 12 29 34 15 ;33 20 19 6 29 34 3 26 25 12 35 4 9 32 31 18 5 10 15 2 1 24 11 16 21 8 7 30 17 22 27 14 13 36 23 28 ;28 3 8 7 24 17 34 9 14 13 30 23 4 15 20 19 36 29 10 21 26 25 6 35 16 27 32 31 12 5 22 33 2 1 18 11 ;11 16 9 14 1 36 17 22 15 20 7 6 23 28 21 26 13 12 29 34 27 32 19 18 35 4 33 2 25 24 5 10 3 8 31 30 ;30 5 10 27 2 25 36 11 16 33 8 31 6 17 22 3 14 1 12 23 28 9 20 7 18 29 34 15 26 13 24 35 4 21 32 19 ;19 18 29 28 21 32 25 24 35 34 27 2 31 30 5 4 33 8 1 36 11 10 3 14 7 6 17 16 9 20 13 12 23 22 15 26 ;2 1 24 5 10 27 8 7 30 11 16 33 14 13 36 17 22 3 20 19 6 23 28 9 26 25 12 29 34 15 32 31 18 35 4 21 ;3 26 25 12 35 4 9 32 31 18 5 10 15 2 1 24 11 16 21 8 7 30 17 22 27 14 13 36 23 28 33 20 19 6 29 34 ;34 9 14 13 30 23 4 15 20 19 36 29 10 21 26 25 6 35 16 27 32 31 12 5 22 33 2 1 18 11 28 3 8 7 24 17 ;17 22 15 20 7 6 23 28 21 26 13 12 29 34 27 32 19 18 35 4 33 2 25 24 5 10 3 8 31 30 11 16 9 14 1 36 ;36 11 16 33 8 31 6 17 22 3 14 1 12 23 28 9 20 7 18 29 34 15 26 13 24 35 4 21 32 19 30 5 10 27 2 25 ;25 24 35 34 27 2 31 30 5 4 33 8 1 36 11 10 3 14 7 6 17 16 9 20 13 12 23 22 15 26 19 18 29 28 21 32 ;8 7 30 11 16 33 14 13 36 17 22 3 20 19 6 23 28 9 26 25 12 29 34 15 32 31 18 35 4 21 2 1 24 5 10 27 ;9 32 31 18 5 10 15 2 1 24 11 16 21 8 7 30 17 22 27 14 13 36 23 28 33 20 19 6 29 34 3 26 25 12 35 4 ;4 15 20 19 36 29 10 21 26 25 6 35 16 27 32 31 12 5 22 33 2 1 18 11 28 3 8 7 24 17 34 9 14 13 30 23 ;23 28 21 26 13 12 29 34 27 32 19 18 35 4 33 2 25 24 5 10 3 8 31 30 11 16 9 14 1 36 17 22 15 20 7 6 ;6 17 22 3 14 1 12 23 28 9 20 7 18 29 34 15 26 13 24 35 4 21 32 19 30 5 10 27 2 25 36 11 16 33 8 31 ;31 30 5 4 33 8 1 36 11 10 3 14 7 6 17 16 9 20 13 12 23 22 15 26 19 18 29 28 21 32 25 24 35 34 27 2 ;14 13 36 17 22 3 20 19 6 23 28 9 26 25 12 29 34 15 32 31 18 35 4 21 2 1 24 5 10 27 8 7 30 11 16 33 ;15 2 1 24 11 16 21 8 7 30 17 22 27 14 13 36 23 28 33 20 19 6 29 34 3 26 25 12 35 4 9 32 31 18 5 10 ;10 21 26 25 6 35 16 27 32 31 12 5 22 33 2 1 18 11 28 3 8 7 24 17 34 9 14 13 30 23 4 15 20 19 36 29 ;29 34 27 32 19 18 35 4 33 2 25 24 5 10 3 8 31 30 11 16 9 14 1 36 17 22 15 20 7 6 23 28 21 26 13 12 ;12 23 28 9 20 7 18 29 34 15 26 13 24 35 4 21 32 19 30 5 10 27 2 25 36 11 16 33 8 31 6 17 22 3 14 1 ;1 36 11 10 3 14 7 6 17 16 9 20 13 12 23 22 15 26 19 18 29 28 21 32 25 24 35 34 27 2 31 30 5 4 33 8 ;20 19 6 23 28 9 26 25 12 29 34 15 32 31 18 35 4 21 2 1 24 5 10 27 8 7 30 11 16 33 14 13 36 17 22 3 ;21 8 7 30 17 22 27 14 13 36 23 28 33 20 19 6 29 34 3 26 25 12 35 4 9 32 31 18 5 10 15 2 1 24 11 16 ;16 27 32 31 12 5 22 33 2 1 18 11 28 3 8 7 24 17 34 9 14 13 30 23 4 15 20 19 36 29 10 21 26 25 6 35 ;35 4 33 2 25 24 5 10 3 8 31 30 11 16 9 14 1 36 17 22 15 20 7 6 23 28 21 26 13 12 29 34 27 32 19 18 ;18 29 34 15 26 13 24 35 4 21 32 19 30 5 10 27 2 25 36 11 16 33 8 31 6 17 22 3 14 1 12 23 28 9 20 7 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 8 11 2 5 12 15 6 9 16 3 10 13 4 7 14 ;14 9 12 7 2 13 16 11 6 1 4 15 10 5 8 3 ;3 10 13 4 7 14 1 8 11 2 5 12 15 6 9 16 ;16 15 6 5 4 3 10 9 8 7 14 13 12 11 2 1 ;5 12 15 6 9 16 3 10 13 4 7 14 1 8 11 2 ;2 13 16 11 6 1 4 15 10 5 8 3 14 9 12 7 ;7 14 1 8 11 2 5 12 15 6 9 16 3 10 13 4 ;4 3 10 9 8 7 14 13 12 11 2 1 16 15 6 5 ;9 16 3 10 13 4 7 14 1 8 11 2 5 12 15 6 ;6 1 4 15 10 5 8 3 14 9 12 7 2 13 16 11 ;11 2 5 12 15 6 9 16 3 10 13 4 7 14 1 8 ;8 7 14 13 12 11 2 1 16 15 6 5 4 3 10 9 ;13 4 7 14 1 8 11 2 5 12 15 6 9 16 3 10 ;10 5 8 3 14 9 12 7 2 13 16 11 6 1 4 15 ;15 6 9 16 3 10 13 4 7 14 1 8 11 2 5 12 ;12 11 2 1 16 15 6 5 4 3 10 9 8 7 14 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[7 36 29 16 21 14 13 6 35 22 27 20 19 12 5 28 33 26 25 18 11 34 3 32 31 24 17 4 9 2 1 30 23 10 15 8 ;20 31 24 35 34 27 26 1 30 5 4 33 32 7 36 11 10 3 2 13 6 17 16 9 8 19 12 23 22 15 14 25 18 29 28 21 ;3 8 13 6 17 4 9 14 19 12 23 10 15 20 25 18 29 16 21 26 31 24 35 22 27 32 1 30 5 28 33 2 7 36 11 34 ;10 9 26 19 18 5 16 15 32 25 24 11 22 21 2 31 30 17 28 27 8 1 36 23 34 33 14 7 6 29 4 3 20 13 12 35 ;11 22 33 32 1 30 17 28 3 2 7 36 23 34 9 8 13 6 29 4 15 14 19 12 35 10 21 20 25 18 5 16 27 26 31 24 ;12 23 28 15 2 25 18 29 34 21 8 31 24 35 4 27 14 1 30 5 10 33 20 7 36 11 16 3 26 13 6 17 22 9 32 19 ;13 6 35 22 27 20 19 12 5 28 33 26 25 18 11 34 3 32 31 24 17 4 9 2 1 30 23 10 15 8 7 36 29 16 21 14 ;26 1 30 5 4 33 32 7 36 11 10 3 2 13 6 17 16 9 8 19 12 23 22 15 14 25 18 29 28 21 20 31 24 35 34 27 ;9 14 19 12 23 10 15 20 25 18 29 16 21 26 31 24 35 22 27 32 1 30 5 28 33 2 7 36 11 34 3 8 13 6 17 4 ;16 15 32 25 24 11 22 21 2 31 30 17 28 27 8 1 36 23 34 33 14 7 6 29 4 3 20 13 12 35 10 9 26 19 18 5 ;17 28 3 2 7 36 23 34 9 8 13 6 29 4 15 14 19 12 35 10 21 20 25 18 5 16 27 26 31 24 11 22 33 32 1 30 ;18 29 34 21 8 31 24 35 4 27 14 1 30 5 10 33 20 7 36 11 16 3 26 13 6 17 22 9 32 19 12 23 28 15 2 25 ;19 12 5 28 33 26 25 18 11 34 3 32 31 24 17 4 9 2 1 30 23 10 15 8 7 36 29 16 21 14 13 6 35 22 27 20 ;32 7 36 11 10 3 2 13 6 17 16 9 8 19 12 23 22 15 14 25 18 29 28 21 20 31 24 35 34 27 26 1 30 5 4 33 ;15 20 25 18 29 16 21 26 31 24 35 22 27 32 1 30 5 28 33 2 7 36 11 34 3 8 13 6 17 4 9 14 19 12 23 10 ;22 21 2 31 30 17 28 27 8 1 36 23 34 33 14 7 6 29 4 3 20 13 12 35 10 9 26 19 18 5 16 15 32 25 24 11 ;23 34 9 8 13 6 29 4 15 14 19 12 35 10 21 20 25 18 5 16 27 26 31 24 11 22 33 32 1 30 17 28 3 2 7 36 ;24 35 4 27 14 1 30 5 10 33 20 7 36 11 16 3 26 13 6 17 22 9 32 19 12 23 28 15 2 25 18 29 34 21 8 31 ;25 18 11 34 3 32 31 24 17 4 9 2 1 30 23 10 15 8 7 36 29 16 21 14 13 6 35 22 27 20 19 12 5 28 33 26 ;2 13 6 17 16 9 8 19 12 23 22 15 14 25 18 29 28 21 20 31 24 35 34 27 26 1 30 5 4 33 32 7 36 11 10 3 ;21 26 31 24 35 22 27 32 1 30 5 28 33 2 7 36 11 34 3 8 13 6 17 4 9 14 19 12 23 10 15 20 25 18 29 16 ;28 27 8 1 36 23 34 33 14 7 6 29 4 3 20 13 12 35 10 9 26 19 18 5 16 15 32 25 24 11 22 21 2 31 30 17 ;29 4 15 14 19 12 35 10 21 20 25 18 5 16 27 26 31 24 11 22 33 32 1 30 17 28 3 2 7 36 23 34 9 8 13 6 ;30 5 10 33 20 7 36 11 16 3 26 13 6 17 22 9 32 19 12 23 28 15 2 25 18 29 34 21 8 31 24 35 4 27 14 1 ;31 24 17 4 9 2 1 30 23 10 15 8 7 36 29 16 21 14 13 6 35 22 27 20 19 12 5 28 33 26 25 18 11 34 3 32 ;8 19 12 23 22 15 14 25 18 29 28 21 20 31 24 35 34 27 26 1 30 5 4 33 32 7 36 11 10 3 2 13 6 17 16 9 ;27 32 1 30 5 28 33 2 7 36 11 34 3 8 13 6 17 4 9 14 19 12 23 10 15 20 25 18 29 16 21 26 31 24 35 22 ;34 33 14 7 6 29 4 3 20 13 12 35 10 9 26 19 18 5 16 15 32 25 24 11 22 21 2 31 30 17 28 27 8 1 36 23 ;35 10 21 20 25 18 5 16 27 26 31 24 11 22 33 32 1 30 17 28 3 2 7 36 23 34 9 8 13 6 29 4 15 14 19 12 ;36 11 16 3 26 13 6 17 22 9 32 19 12 23 28 15 2 25 18 29 34 21 8 31 24 35 4 27 14 1 30 5 10 33 20 7 ;1 30 23 10 15 8 7 36 29 16 21 14 13 6 35 22 27 20 19 12 5 28 33 26 25 18 11 34 3 32 31 24 17 4 9 2 ;14 25 18 29 28 21 20 31 24 35 34 27 26 1 30 5 4 33 32 7 36 11 10 3 2 13 6 17 16 9 8 19 12 23 22 15 ;33 2 7 36 11 34 3 8 13 6 17 4 9 14 19 12 23 10 15 20 25 18 29 16 21 26 31 24 35 22 27 32 1 30 5 28 ;4 3 20 13 12 35 10 9 26 19 18 5 16 15 32 25 24 11 22 21 2 31 30 17 28 27 8 1 36 23 34 33 14 7 6 29 ;5 16 27 26 31 24 11 22 33 32 1 30 17 28 3 2 7 36 23 34 9 8 13 6 29 4 15 14 19 12 35 10 21 20 25 18 ;6 17 22 9 32 19 12 23 28 15 2 25 18 29 34 21 8 31 24 35 4 27 14 1 30 5 10 33 20 7 36 11 16 3 26 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[7 3 8 1 6 2 4 9 5 ;2 1 6 5 4 9 8 7 3 ;9 5 4 3 8 7 6 2 1 ;1 6 2 4 9 5 7 3 8 ;5 4 9 8 7 3 2 1 6 ;3 8 7 6 2 1 9 5 4 ;4 9 6 7 3 8 1 6 2 ;8 7 3 2 1 6 5 4 9 ;6 2 1 9 5 4 3 8 7 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[9 16 3 2 13 4 7 6 1 8 11 10 5 12 15 14 ;6 13 4 15 10 1 8 3 14 5 12 7 2 9 16 11 ;11 14 1 12 15 2 5 16 3 6 9 4 7 10 13 8 ;8 7 10 5 12 11 14 9 16 15 2 13 4 3 6 1 ;13 4 7 6 1 8 11 10 5 12 15 14 9 16 3 2 ;10 1 8 3 14 5 12 7 2 9 16 11 6 13 4 15 ;15 2 5 16 3 6 9 4 7 10 13 8 11 14 1 12 ;12 11 14 9 16 15 2 13 4 3 6 1 8 7 10 5 ;1 8 11 10 5 12 15 14 9 16 3 2 13 4 7 6 ;14 5 12 7 2 9 16 11 6 13 4 15 10 1 8 3 ;3 6 9 4 7 10 13 8 11 14 1 12 15 2 5 16 ;16 15 2 13 4 3 6 1 8 7 10 5 12 11 14 9 ;5 12 15 14 9 16 3 2 13 4 7 6 1 8 11 10 ;2 9 16 11 6 13 4 15 10 1 8 3 14 5 12 7 ;7 10 13 8 11 14 1 12 15 2 5 16 3 6 9 4 ;4 3 6 1 8 7 10 5 12 11 14 9 16 15 2 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[16 20 14 18 2 21 25 19 23 7 1 5 24 3 12 6 10 4 8 17 11 15 9 13 22 ;22 11 25 19 8 2 16 5 24 13 7 21 10 4 18 12 1 15 9 23 17 6 20 14 3 ;3 12 6 5 24 8 17 11 10 4 13 22 16 15 9 18 2 21 20 14 23 7 1 25 19 ;4 13 7 21 10 9 18 12 1 15 14 23 17 6 20 19 3 22 11 25 24 8 2 16 5 ;15 9 23 17 1 20 14 3 22 6 25 19 8 2 11 5 24 13 7 16 10 4 18 12 21 ;21 25 19 23 7 1 5 24 3 12 6 10 4 8 17 11 15 9 13 22 16 20 14 18 2 ;2 16 5 24 13 7 21 10 4 18 12 1 15 9 23 17 6 20 14 3 22 11 25 19 8 ;8 17 11 10 4 13 22 16 15 9 18 2 21 20 14 23 7 1 25 19 3 12 6 5 24 ;9 18 12 1 15 14 23 17 6 20 19 3 22 11 25 24 8 2 16 5 4 13 7 21 10 ;20 14 3 22 6 25 19 8 2 11 5 24 13 7 16 10 4 18 12 21 15 9 23 17 1 ;1 5 24 3 12 6 10 4 8 17 11 15 9 13 22 16 20 14 18 2 21 25 19 23 7 ;7 21 10 4 18 12 1 15 9 23 17 6 20 14 3 22 11 25 19 8 2 16 5 24 13 ;13 22 16 15 9 18 2 21 20 14 23 7 1 25 19 3 12 6 5 24 8 17 11 10 4 ;14 23 17 6 20 19 3 22 11 25 24 8 2 16 5 4 13 7 21 10 9 18 12 1 15 ;25 19 8 2 11 5 24 13 7 16 10 4 18 12 21 15 9 23 17 1 20 14 3 22 6 ;6 10 4 8 17 11 15 9 13 22 16 20 14 18 2 21 25 19 23 7 1 5 24 3 12 ;12 1 15 9 23 17 6 20 14 3 22 11 25 19 8 2 16 5 24 13 7 21 10 4 18 ;18 2 21 20 14 23 7 1 25 19 3 12 6 5 24 8 17 11 10 4 13 22 16 15 9 ;19 3 22 11 25 24 8 2 16 5 4 13 7 21 10 9 18 12 1 15 14 23 17 6 20 ;5 24 13 7 16 10 4 18 12 21 15 9 23 17 1 20 14 3 22 6 25 19 8 2 11 ;11 15 9 13 22 16 20 14 18 2 21 25 19 23 7 1 5 24 3 12 6 10 4 8 17 ;17 6 20 14 3 22 11 25 19 8 2 16 5 24 13 7 21 10 4 18 12 1 15 9 23 ;23 7 1 25 19 3 12 6 5 24 8 17 11 10 4 13 22 16 15 9 18 2 21 20 14 ;24 8 2 16 5 4 13 7 21 10 9 18 12 1 15 14 23 17 6 20 19 3 22 11 25 ;10 4 18 12 21 15 9 23 17 1 20 14 3 22 6 25 19 8 2 11 5 24 13 7 16 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 20 4 3 2 6 25 9 8 7 11 5 14 13 12 16 10 19 18 17 21 15 24 23 22 ;17 11 25 24 23 22 16 5 4 3 2 21 10 9 8 7 1 15 14 13 12 6 20 19 18 ;8 12 6 15 14 13 17 11 20 19 18 22 16 25 24 23 2 21 5 4 3 7 1 10 9 ;19 18 22 21 10 24 23 2 1 15 4 3 7 6 20 9 8 12 11 25 14 13 17 16 5 ;5 9 13 7 16 10 14 18 12 21 15 19 23 17 1 20 24 3 22 6 25 4 8 2 11 ;6 25 9 8 7 11 5 14 13 12 16 10 19 18 17 21 15 24 23 22 1 20 4 3 2 ;22 16 5 4 3 2 21 10 9 8 7 1 15 14 13 12 6 20 19 18 17 11 25 24 23 ;13 17 11 20 19 18 22 16 25 24 23 2 21 5 4 3 7 1 10 9 8 12 6 15 14 ;24 23 2 1 15 4 3 7 6 20 9 8 12 11 25 14 13 17 16 5 19 18 22 21 10 ;10 14 18 12 21 15 19 23 17 1 20 24 3 22 6 25 4 8 2 11 5 9 13 7 16 ;11 5 14 13 12 16 10 19 18 17 21 15 24 23 22 1 20 4 3 2 6 25 9 8 7 ;2 21 10 9 8 7 1 15 14 13 12 6 20 19 18 17 11 25 24 23 22 16 5 4 3 ;18 22 16 25 24 23 2 21 5 4 3 7 1 10 9 8 12 6 15 14 13 17 11 20 19 ;4 3 7 6 20 9 8 12 11 25 14 13 17 16 5 19 18 22 21 10 24 23 2 1 15 ;15 19 23 17 1 20 24 3 22 6 25 4 8 2 11 5 9 13 7 16 10 14 18 12 21 ;16 10 19 18 17 21 15 24 23 22 1 20 4 3 2 6 25 9 8 7 11 5 14 13 12 ;7 1 15 14 13 12 6 20 19 18 17 11 25 24 23 22 16 5 4 3 2 21 10 9 8 ;23 2 21 5 4 3 7 1 10 9 8 12 6 15 14 13 17 11 20 19 18 22 16 25 24 ;9 8 12 11 25 14 13 17 16 5 19 18 22 21 10 24 23 2 1 15 4 3 7 6 20 ;20 24 3 22 6 25 4 8 2 11 5 9 13 7 16 10 14 18 12 21 15 19 23 17 1 ;21 15 24 23 22 1 20 4 3 2 6 25 9 8 7 11 5 14 13 12 16 10 19 18 17 ;12 6 20 19 18 17 11 25 24 23 22 16 5 4 3 2 21 10 9 8 7 1 15 14 13 ;3 7 1 10 9 8 12 6 15 14 13 17 11 20 19 18 22 16 25 24 23 2 21 5 4 ;14 13 17 16 5 19 18 22 21 10 24 23 2 1 15 4 3 7 6 20 9 8 12 11 25 ;25 4 8 2 11 5 9 13 7 16 10 14 18 12 21 15 19 23 17 1 20 24 3 22 6 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 24 17 16 27 8 7 30 23 22 33 14 13 36 29 28 3 20 19 6 35 34 9 26 25 12 5 4 15 32 31 18 11 10 21 2 ;20 13 6 11 34 15 26 19 12 17 4 21 32 25 18 23 10 27 2 31 24 29 16 33 8 1 30 35 22 3 14 7 36 5 28 9 ;33 14 19 30 23 22 3 20 25 36 29 28 9 26 31 6 35 34 15 32 1 12 5 4 21 2 7 18 11 10 27 8 13 24 17 16 ;4 9 32 31 36 29 10 15 2 1 6 35 16 21 8 7 12 5 22 27 14 13 18 11 28 33 20 19 24 17 34 3 26 25 30 23 ;35 28 21 2 7 12 5 34 27 8 13 18 11 4 33 14 19 24 17 10 3 20 25 30 23 16 9 26 31 36 29 22 15 32 1 6 ;18 5 10 3 26 25 24 11 16 9 32 31 30 17 22 15 2 1 36 23 28 21 8 7 6 29 34 27 14 13 12 35 4 33 20 19 ;7 30 23 22 33 14 13 36 29 28 3 20 19 6 35 34 9 26 25 12 5 4 15 32 31 18 11 10 21 2 1 24 17 16 27 8 ;26 19 12 17 4 21 32 25 18 23 10 27 2 31 24 29 16 33 8 1 30 35 22 3 14 7 36 5 28 9 20 13 6 11 34 15 ;3 20 25 36 29 28 9 26 31 6 35 34 15 32 1 12 5 4 21 2 7 18 11 10 27 8 13 24 17 16 33 14 19 30 23 22 ;10 15 2 1 6 35 16 21 8 7 12 5 22 27 14 13 18 11 28 33 20 19 24 17 34 3 26 25 30 23 4 9 32 31 36 29 ;5 34 27 8 13 18 11 4 33 14 19 24 17 10 3 20 25 30 23 16 9 26 31 36 29 22 15 32 1 6 35 28 21 2 7 12 ;24 11 16 9 32 31 30 17 22 15 2 1 36 23 28 21 8 7 6 29 34 27 14 13 12 35 4 33 20 19 18 5 10 3 26 25 ;13 36 29 28 3 20 19 6 35 34 9 26 25 12 5 4 15 32 31 18 11 10 21 2 1 24 17 16 27 8 7 30 23 22 33 14 ;32 25 18 23 10 27 2 31 24 29 16 33 8 1 30 35 22 3 14 7 36 5 28 9 20 13 6 11 34 15 26 19 12 17 4 21 ;9 26 31 6 35 34 15 32 1 12 5 4 21 2 7 18 11 10 27 8 13 24 17 16 33 14 19 30 23 22 3 20 25 36 29 28 ;16 21 8 7 12 5 22 27 14 13 18 11 28 33 20 19 24 17 34 3 26 25 30 23 4 9 32 31 36 29 10 15 2 1 6 35 ;11 4 33 14 19 24 17 10 3 20 25 30 23 16 9 26 31 36 29 22 15 32 1 6 35 28 21 2 7 12 5 34 27 8 13 18 ;30 17 22 15 2 1 36 23 28 21 8 7 6 29 34 27 14 13 12 35 4 33 20 19 18 5 10 3 26 25 24 11 16 9 32 31 ;19 6 35 34 9 26 25 12 5 4 15 32 31 18 11 10 21 2 1 24 17 16 27 8 7 30 23 22 33 14 13 36 29 28 3 20 ;2 31 24 29 16 33 8 1 30 35 22 3 14 7 36 5 28 9 20 13 6 11 34 15 26 19 12 17 4 21 32 25 18 23 10 27 ;15 32 1 12 5 4 21 2 7 18 11 10 27 8 13 24 17 16 33 14 19 30 23 22 3 20 25 36 29 28 9 26 31 6 35 34 ;22 27 14 13 18 11 28 33 20 19 24 17 34 3 26 25 30 23 4 9 32 31 36 29 10 15 2 1 6 35 16 21 8 7 12 5 ;17 10 3 20 25 30 23 16 9 26 31 36 29 22 15 32 1 6 35 28 21 2 7 12 5 34 27 8 13 18 11 4 33 14 19 24 ;36 23 28 21 8 7 6 29 34 27 14 13 12 35 4 33 20 19 18 5 10 3 26 25 24 11 16 9 32 31 30 17 22 15 2 1 ;25 12 5 4 15 32 31 18 11 10 21 2 1 24 17 16 27 8 7 30 23 22 33 14 13 36 29 28 3 20 19 6 35 34 9 26 ;8 1 30 35 22 3 14 7 36 5 28 9 20 13 6 11 34 15 26 19 12 17 4 21 32 25 18 23 10 27 2 31 24 29 16 33 ;21 2 7 18 11 10 27 8 13 24 17 16 33 14 19 30 23 22 3 20 25 36 29 28 9 26 31 6 35 34 15 32 1 12 5 4 ;28 33 20 19 24 17 34 3 26 25 30 23 4 9 32 31 36 29 10 15 2 1 6 35 16 21 8 7 12 5 22 27 14 13 18 11 ;23 16 9 26 31 36 29 22 15 32 1 6 35 28 21 2 7 12 5 34 27 8 13 18 11 4 33 14 19 24 17 10 3 20 25 30 ;6 29 34 27 14 13 12 35 4 33 20 19 18 5 10 3 26 25 24 11 16 9 32 31 30 17 22 15 2 1 36 23 28 21 8 7 ;31 18 11 10 21 2 1 24 17 16 27 8 7 30 23 22 33 14 13 36 29 28 3 20 19 6 35 34 9 26 25 12 5 4 15 32 ;14 7 36 5 28 9 20 13 6 11 34 15 26 19 12 17 4 21 32 25 18 23 10 27 2 31 24 29 16 33 8 1 30 35 22 3 ;27 8 13 24 17 16 33 14 19 30 23 22 3 20 25 36 29 28 9 26 31 6 35 34 15 32 1 12 5 4 21 2 7 18 11 10 ;34 3 26 25 30 23 4 9 32 31 36 29 10 15 2 1 6 35 16 21 8 7 12 5 22 27 14 13 18 11 28 33 20 19 24 17 ;29 22 15 32 1 6 35 28 21 2 7 12 5 34 27 8 13 18 11 4 33 14 19 24 17 10 3 20 25 30 23 16 9 26 31 36 ;12 35 4 33 20 19 18 5 10 3 26 25 24 11 16 9 32 31 30 17 22 15 2 1 36 23 28 21 8 7 6 29 34 27 14 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[4 3 8 7 6 2 1 9 5 ;2 1 9 5 4 3 8 7 6 ;6 5 7 9 8 1 3 2 4 ;7 6 2 1 9 5 4 3 8 ;5 4 3 8 7 6 2 1 9 ;9 8 1 3 2 4 6 5 7 ;1 9 5 4 3 8 7 6 2 ;8 7 6 2 1 9 5 4 3 ;3 2 4 6 5 7 9 8 1 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 9 8 4 3 2 7 6 5 ;2 7 6 5 1 9 8 4 3 ;3 5 4 6 8 7 9 2 1 ;4 3 2 7 6 5 1 9 8 ;5 1 9 8 4 3 2 7 6 ;6 8 7 9 2 1 3 5 4 ;7 6 5 1 9 8 4 3 2 ;8 4 3 2 7 6 5 1 9 ;9 2 1 3 5 4 6 8 7 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[11 10 24 3 22 16 15 4 8 2 21 20 9 13 7 1 25 14 18 12 6 5 19 23 17 ;7 16 25 14 13 12 21 5 19 18 17 1 10 24 23 22 6 15 4 3 2 11 20 9 8 ;23 2 21 5 4 3 7 1 10 9 8 12 6 15 14 13 17 11 20 19 18 22 16 25 24 ;9 8 12 6 20 14 13 17 11 25 19 18 22 16 5 24 23 2 21 10 4 3 7 1 15 ;15 19 18 17 1 20 24 23 22 6 25 4 3 2 11 5 9 8 7 16 10 14 13 12 21 ;16 15 4 8 2 21 20 9 13 7 1 25 14 18 12 6 5 19 23 17 11 10 24 3 22 ;12 21 5 19 18 17 1 10 24 23 22 6 15 4 3 2 11 20 9 8 7 16 25 14 13 ;3 7 1 10 9 8 12 6 15 14 13 17 11 20 19 18 22 16 25 24 23 2 21 5 4 ;14 13 17 11 25 19 18 22 16 5 24 23 2 21 10 4 3 7 1 15 9 8 12 6 20 ;20 24 23 22 6 25 4 3 2 11 5 9 8 7 16 10 14 13 12 21 15 19 18 17 1 ;21 20 9 13 7 1 25 14 18 12 6 5 19 23 17 11 10 24 3 22 16 15 4 8 2 ;17 1 10 24 23 22 6 15 4 3 2 11 20 9 8 7 16 25 14 13 12 21 5 19 18 ;8 12 6 15 14 13 17 11 20 19 18 22 16 25 24 23 2 21 5 4 3 7 1 10 9 ;19 18 22 16 5 24 23 2 21 10 4 3 7 1 15 9 8 12 6 20 14 13 17 11 25 ;25 4 3 2 11 5 9 8 7 16 10 14 13 12 21 15 19 18 17 1 20 24 23 22 6 ;1 25 14 18 12 6 5 19 23 17 11 10 24 3 22 16 15 4 8 2 21 20 9 13 7 ;22 6 15 4 3 2 11 20 9 8 7 16 25 14 13 12 21 5 19 18 17 1 10 24 23 ;13 17 11 20 19 18 22 16 25 24 23 2 21 5 4 3 7 1 10 9 8 12 6 15 14 ;24 23 2 21 10 4 3 7 1 15 9 8 12 6 20 14 13 17 11 25 19 18 22 16 5 ;5 9 8 7 16 10 14 13 12 21 15 19 18 17 1 20 24 23 22 6 25 4 3 2 11 ;6 5 19 23 17 11 10 24 3 22 16 15 4 8 2 21 20 9 13 7 1 25 14 18 12 ;2 11 20 9 8 7 16 25 14 13 12 21 5 19 18 17 1 10 24 23 22 6 15 4 3 ;18 22 16 25 24 23 2 21 5 4 3 7 1 10 9 8 12 6 15 14 13 17 11 20 19 ;4 3 7 1 15 9 8 12 6 20 14 13 17 11 25 19 18 22 16 5 24 23 2 21 10 ;10 14 13 12 21 15 19 18 17 1 20 24 23 22 6 25 4 3 2 11 5 9 8 7 16 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 24 11 34 3 14 7 30 17 4 9 20 13 36 23 10 15 26 19 6 29 16 21 32 25 12 35 22 27 2 31 18 5 28 33 8 ;8 13 18 17 16 27 14 19 24 23 22 33 20 25 30 29 28 3 26 31 36 35 34 9 32 1 6 5 4 15 2 7 12 11 10 21 ;21 32 7 12 23 28 27 2 13 18 29 34 33 8 19 24 35 4 3 14 25 30 5 10 9 20 31 36 11 16 15 26 1 6 17 22 ;10 15 2 19 6 35 16 21 8 25 12 5 22 27 14 31 18 11 28 33 20 1 24 17 34 3 26 7 30 23 4 9 32 13 36 29 ;5 4 33 20 31 30 11 10 3 26 1 36 17 16 9 32 7 6 23 22 15 2 13 12 29 28 21 8 19 18 35 34 27 14 25 24 ;36 29 22 9 26 25 6 35 28 15 32 31 12 5 34 21 2 1 18 11 4 27 8 7 24 17 10 33 14 13 30 23 16 3 20 19 ;7 30 17 4 9 20 13 36 23 10 15 26 19 6 29 16 21 32 25 12 35 22 27 2 31 18 5 28 33 8 1 24 11 34 3 14 ;14 19 24 23 22 33 20 25 30 29 28 3 26 31 36 35 34 9 32 1 6 5 4 15 2 7 12 11 10 21 8 13 18 17 16 27 ;27 2 13 18 29 34 33 8 19 24 35 4 3 14 25 30 5 10 9 20 31 36 11 16 15 26 1 6 17 22 21 32 7 12 23 28 ;16 21 8 25 12 5 22 27 14 31 18 11 28 33 20 1 24 17 34 3 26 7 30 23 4 9 32 13 36 29 10 15 2 19 6 35 ;11 10 3 26 1 36 17 16 9 32 7 6 23 22 15 2 13 12 29 28 21 8 19 18 35 34 27 14 25 24 5 4 33 20 31 30 ;6 35 28 15 32 31 12 5 34 21 2 1 18 11 4 27 8 7 24 17 10 33 14 13 30 23 16 3 20 19 36 29 22 9 26 25 ;13 36 23 10 15 26 19 6 29 16 21 32 25 12 35 22 27 2 31 18 5 28 33 8 1 24 11 34 3 14 7 30 17 4 9 20 ;20 25 30 29 28 3 26 31 36 35 34 9 32 1 6 5 4 15 2 7 12 11 10 21 8 13 18 17 16 27 14 19 24 23 22 33 ;33 8 19 24 35 4 3 14 25 30 5 10 9 20 31 36 11 16 15 26 1 6 17 22 21 32 7 12 23 28 27 2 13 18 29 34 ;22 27 14 31 18 11 28 33 20 1 24 17 34 3 26 7 30 23 4 9 32 13 36 29 10 15 2 19 6 35 16 21 8 25 12 5 ;17 16 9 32 7 6 23 22 15 2 13 12 29 28 21 8 19 18 35 34 27 14 25 24 5 4 33 20 31 30 11 10 3 26 1 36 ;12 5 34 21 2 1 18 11 4 27 8 7 24 17 10 33 14 13 30 23 16 3 20 19 36 29 22 9 26 25 6 35 28 15 32 31 ;19 6 29 16 21 32 25 12 35 22 27 2 31 18 5 28 33 8 1 24 11 34 3 14 7 30 17 4 9 20 13 36 23 10 15 26 ;26 31 36 35 34 9 32 1 6 5 4 15 2 7 12 11 10 21 8 13 18 17 16 27 14 19 24 23 22 33 20 25 30 29 28 3 ;3 14 25 30 5 10 9 20 31 36 11 16 15 26 1 6 17 22 21 32 7 12 23 28 27 2 13 18 29 34 33 8 19 24 35 4 ;28 33 20 1 24 17 34 3 26 7 30 23 4 9 32 13 36 29 10 15 2 19 6 35 16 21 8 25 12 5 22 27 14 31 18 11 ;23 22 15 2 13 12 29 28 21 8 19 18 35 34 27 14 25 24 5 4 33 20 31 30 11 10 3 26 1 36 17 16 9 32 7 6 ;18 11 4 27 8 7 24 17 10 33 14 13 30 23 16 3 20 19 36 29 22 9 26 25 6 35 28 15 32 31 12 5 34 21 2 1 ;25 12 35 22 27 2 31 18 5 28 33 8 1 24 11 34 3 14 7 30 17 4 9 20 13 36 23 10 15 26 19 6 29 16 21 32 ;32 1 6 5 4 15 2 7 12 11 10 21 8 13 18 17 16 27 14 19 24 23 22 33 20 25 30 29 28 3 26 31 36 35 34 9 ;9 20 31 36 11 16 15 26 1 6 17 22 21 32 7 12 23 28 27 2 13 18 29 34 33 8 19 24 35 4 3 14 25 30 5 10 ;34 3 26 7 30 23 4 9 32 13 36 29 10 15 2 19 6 35 16 21 8 25 12 5 22 27 14 31 18 11 28 33 20 1 24 17 ;29 28 21 8 19 18 35 34 27 14 25 24 5 4 33 20 31 30 11 10 3 26 1 36 17 16 9 32 7 6 23 22 15 2 13 12 ;24 17 10 33 14 13 30 23 16 3 20 19 36 29 22 9 26 25 6 35 28 15 32 31 12 5 34 21 2 1 18 11 4 27 8 7 ;31 18 5 28 33 8 1 24 11 34 3 14 7 30 17 4 9 20 13 36 23 10 15 26 19 6 29 16 21 32 25 12 35 22 27 2 ;2 7 12 11 10 21 8 13 18 17 16 27 14 19 24 23 22 33 20 25 30 29 28 3 26 31 36 35 34 9 32 1 6 5 4 15 ;15 26 1 6 17 22 21 32 7 12 23 28 27 2 13 18 29 34 33 8 19 24 35 4 3 14 25 30 5 10 9 20 31 36 11 16 ;4 9 32 13 36 29 10 15 2 19 6 35 16 21 8 25 12 5 22 27 14 31 18 11 28 33 20 1 24 17 34 3 26 7 30 23 ;35 34 27 14 25 24 5 4 33 20 31 30 11 10 3 26 1 36 17 16 9 32 7 6 23 22 15 2 13 12 29 28 21 8 19 18 ;30 23 16 3 20 19 36 29 22 9 26 25 6 35 28 15 32 31 12 5 34 21 2 1 18 11 4 27 8 7 24 17 10 33 14 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[13 36 17 16 15 20 19 6 23 22 21 26 25 12 29 28 27 32 31 18 35 34 33 2 1 24 5 4 3 8 7 30 11 10 9 14 ;2 31 18 35 4 27 8 1 24 5 10 33 14 7 30 11 16 3 20 13 36 17 22 9 26 19 6 23 28 15 32 25 12 29 34 21 ;3 8 19 24 23 10 9 14 25 30 29 16 15 20 31 36 35 22 21 26 1 6 5 28 27 32 7 12 11 34 33 2 13 18 17 4 ;22 21 14 1 30 11 28 27 20 7 36 17 34 33 26 13 6 23 4 3 32 19 12 29 10 9 2 25 18 35 16 15 8 31 24 5 ;5 34 33 26 7 12 11 4 3 32 13 18 17 10 9 2 19 24 23 16 15 8 25 30 29 22 21 14 31 36 35 28 27 20 1 6 ;6 29 28 9 32 25 12 35 34 15 2 31 18 5 4 21 8 1 24 11 10 27 14 7 30 17 16 33 20 13 36 23 22 3 26 19 ;19 6 23 22 21 26 25 12 29 28 27 32 31 18 35 34 33 2 1 24 5 4 3 8 7 30 11 10 9 14 13 36 17 16 15 20 ;8 1 24 5 10 33 14 7 30 11 16 3 20 13 36 17 22 9 26 19 6 23 28 15 32 25 12 29 34 21 2 31 18 35 4 27 ;9 14 25 30 29 16 15 20 31 36 35 22 21 26 1 6 5 28 27 32 7 12 11 34 33 2 13 18 17 4 3 8 19 24 23 10 ;28 27 20 7 36 17 34 33 26 13 6 23 4 3 32 19 12 29 10 9 2 25 18 35 16 15 8 31 24 5 22 21 14 1 30 11 ;11 4 3 32 13 18 17 10 9 2 19 24 23 16 15 8 25 30 29 22 21 14 31 36 35 28 27 20 1 6 5 34 33 26 7 12 ;12 35 34 15 2 31 18 5 4 21 8 1 24 11 10 27 14 7 30 17 16 33 20 13 36 23 22 3 26 19 6 29 28 9 32 25 ;25 12 29 28 27 32 31 18 35 34 33 2 1 24 5 4 3 8 7 30 11 10 9 14 13 36 17 16 15 20 19 6 23 22 21 26 ;14 7 30 11 16 3 20 13 36 17 22 9 26 19 6 23 28 15 32 25 12 29 34 21 2 31 18 35 4 27 8 1 24 5 10 33 ;15 20 31 36 35 22 21 26 1 6 5 28 27 32 7 12 11 34 33 2 13 18 17 4 3 8 19 24 23 10 9 14 25 30 29 16 ;34 33 26 13 6 23 4 3 32 19 12 29 10 9 2 25 18 35 16 15 8 31 24 5 22 21 14 1 30 11 28 27 20 7 36 17 ;17 10 9 2 19 24 23 16 15 8 25 30 29 22 21 14 31 36 35 28 27 20 1 6 5 34 33 26 7 12 11 4 3 32 13 18 ;18 5 4 21 8 1 24 11 10 27 14 7 30 17 16 33 20 13 36 23 22 3 26 19 6 29 28 9 32 25 12 35 34 15 2 31 ;31 18 35 34 33 2 1 24 5 4 3 8 7 30 11 10 9 14 13 36 17 16 15 20 19 6 23 22 21 26 25 12 29 28 27 32 ;20 13 36 17 22 9 26 19 6 23 28 15 32 25 12 29 34 21 2 31 18 35 4 27 8 1 24 5 10 33 14 7 30 11 16 3 ;21 26 1 6 5 28 27 32 7 12 11 34 33 2 13 18 17 4 3 8 19 24 23 10 9 14 25 30 29 16 15 20 31 36 35 22 ;4 3 32 19 12 29 10 9 2 25 18 35 16 15 8 31 24 5 22 21 14 1 30 11 28 27 20 7 36 17 34 33 26 13 6 23 ;23 16 15 8 25 30 29 22 21 14 31 36 35 28 27 20 1 6 5 34 33 26 7 12 11 4 3 32 13 18 17 10 9 2 19 24 ;24 11 10 27 14 7 30 17 16 33 20 13 36 23 22 3 26 19 6 29 28 9 32 25 12 35 34 15 2 31 18 5 4 21 8 1 ;1 24 5 4 3 8 7 30 11 10 9 14 13 36 17 16 15 20 19 6 23 22 21 26 25 12 29 28 27 32 31 18 35 34 33 2 ;26 19 6 23 28 15 32 25 12 29 34 21 2 31 18 35 4 27 8 1 24 5 10 33 14 7 30 11 16 3 20 13 36 17 22 9 ;27 32 7 12 11 34 33 2 13 18 17 4 3 8 19 24 23 10 9 14 25 30 29 16 15 20 31 36 35 22 21 26 1 6 5 28 ;10 9 2 25 18 35 16 15 8 31 24 5 22 21 14 1 30 11 28 27 20 7 36 17 34 33 26 13 6 23 4 3 32 19 12 29 ;29 22 21 14 31 36 35 28 27 20 1 6 5 34 33 26 7 12 11 4 3 32 13 18 17 10 9 2 19 24 23 16 15 8 25 30 ;30 17 16 33 20 13 36 23 22 3 26 19 6 29 28 9 32 25 12 35 34 15 2 31 18 5 4 21 8 1 24 11 10 27 14 7 ;7 30 11 10 9 14 13 36 17 16 15 20 19 6 23 22 21 26 25 12 29 28 27 32 31 18 35 34 33 2 1 24 5 4 3 8 ;32 25 12 29 34 21 2 31 18 35 4 27 8 1 24 5 10 33 14 7 30 11 16 3 20 13 36 17 22 9 26 19 6 23 28 15 ;33 2 13 18 17 4 3 8 19 24 23 10 9 14 25 30 29 16 15 20 31 36 35 22 21 26 1 6 5 28 27 32 7 12 11 34 ;16 15 8 31 24 5 22 21 14 1 30 11 28 27 20 7 36 17 34 33 26 13 6 23 4 3 32 19 12 29 10 9 2 25 18 35 ;35 28 27 20 1 6 5 34 33 26 7 12 11 4 3 32 13 18 17 10 9 2 19 24 23 16 15 8 25 30 29 22 21 14 31 36 ;36 23 22 3 26 19 6 29 28 9 32 25 12 35 34 15 2 31 18 5 4 21 8 1 24 11 10 27 14 7 30 17 16 33 20 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[429 428 430 432 431 433 426 434 427 ;427 426 434 430 429 428 433 432 431 ;431 433 432 434 427 426 428 430 429 ;432 431 433 426 434 427 429 428 430 ;430 429 428 433 432 431 427 426 434 ;434 427 426 428 430 429 431 433 432 ;426 434 427 429 428 430 432 431 433 ;433 432 431 427 426 434 430 429 428 ;428 430 429 431 433 432 434 427 426 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[7 36 35 10 9 32 13 6 5 16 15 2 19 12 11 22 21 8 25 18 17 28 27 14 31 24 23 34 33 20 1 30 29 4 3 26 ;20 13 30 11 4 3 26 19 36 17 10 9 32 25 6 23 16 15 2 31 12 29 22 21 8 1 18 35 28 27 14 7 24 5 34 33 ;15 26 1 24 5 22 21 32 7 30 11 28 27 2 13 36 17 34 33 8 19 6 23 4 3 14 25 12 29 10 9 20 31 18 35 16 ;34 21 14 19 12 17 4 27 20 25 18 23 10 33 26 31 24 29 16 3 32 1 30 35 22 9 2 7 36 5 28 15 8 13 6 11 ;29 28 27 8 25 18 35 34 33 14 31 24 5 4 3 20 1 30 11 10 9 26 7 36 17 16 15 32 13 6 23 22 21 2 19 12 ;6 23 16 33 2 31 12 29 22 3 8 1 18 35 28 9 14 7 24 5 34 15 20 13 30 11 4 21 26 19 36 17 10 27 32 25 ;13 6 5 16 15 2 19 12 11 22 21 8 25 18 17 28 27 14 31 24 23 34 33 20 1 30 29 4 3 26 7 36 35 10 9 32 ;26 19 36 17 10 9 32 25 6 23 16 15 2 31 12 29 22 21 8 1 18 35 28 27 14 7 24 5 34 33 20 13 30 11 4 3 ;21 32 7 30 11 28 27 2 13 36 17 34 33 8 19 6 23 4 3 14 25 12 29 10 9 20 31 18 35 16 15 26 1 24 5 22 ;4 27 20 25 18 23 10 33 26 31 24 29 16 3 32 1 30 35 22 9 2 7 36 5 28 15 8 13 6 11 34 21 14 19 12 17 ;35 34 33 14 31 24 5 4 3 20 1 30 11 10 9 26 7 36 17 16 15 32 13 6 23 22 21 2 19 12 29 28 27 8 25 18 ;12 29 22 3 8 1 18 35 28 9 14 7 24 5 34 15 20 13 30 11 4 21 26 19 36 17 10 27 32 25 6 23 16 33 2 31 ;19 12 11 22 21 8 25 18 17 28 27 14 31 24 23 34 33 20 1 30 29 4 3 26 7 36 35 10 9 32 13 6 5 16 15 2 ;32 25 6 23 16 15 2 31 12 29 22 21 8 1 18 35 28 27 14 7 24 5 34 33 20 13 30 11 4 3 26 19 36 17 10 9 ;27 2 13 36 17 34 33 8 19 6 23 4 3 14 25 12 29 10 9 20 31 18 35 16 15 26 1 24 5 22 21 32 7 30 11 28 ;10 33 26 31 24 29 16 3 32 1 30 35 22 9 2 7 36 5 28 15 8 13 6 11 34 21 14 19 12 17 4 27 20 25 18 23 ;5 4 3 20 1 30 11 10 9 26 7 36 17 16 15 32 13 6 23 22 21 2 19 12 29 28 27 8 25 18 35 34 33 14 31 24 ;18 35 28 9 14 7 24 5 34 15 20 13 30 11 4 21 26 19 36 17 10 27 32 25 6 23 16 33 2 31 12 29 22 3 8 1 ;25 18 17 28 27 14 31 24 23 34 33 20 1 30 29 4 3 26 7 36 35 10 9 32 13 6 5 16 15 2 19 12 11 22 21 8 ;2 31 12 29 22 21 8 1 18 35 28 27 14 7 24 5 34 33 20 13 30 11 4 3 26 19 36 17 10 9 32 25 6 23 16 15 ;33 8 19 6 23 4 3 14 25 12 29 10 9 20 31 18 35 16 15 26 1 24 5 22 21 32 7 30 11 28 27 2 13 36 17 34 ;16 3 32 1 30 35 22 9 2 7 36 5 28 15 8 13 6 11 34 21 14 19 12 17 4 27 20 25 18 23 10 33 26 31 24 29 ;11 10 9 26 7 36 17 16 15 32 13 6 23 22 21 2 19 12 29 28 27 8 25 18 35 34 33 14 31 24 5 4 3 20 1 30 ;24 5 34 15 20 13 30 11 4 21 26 19 36 17 10 27 32 25 6 23 16 33 2 31 12 29 22 3 8 1 18 35 28 9 14 7 ;31 24 23 34 33 20 1 30 29 4 3 26 7 36 35 10 9 32 13 6 5 16 15 2 19 12 11 22 21 8 25 18 17 28 27 14 ;8 1 18 35 28 27 14 7 24 5 34 33 20 13 30 11 4 3 26 19 36 17 10 9 32 25 6 23 16 15 2 31 12 29 22 21 ;3 14 25 12 29 10 9 20 31 18 35 16 15 26 1 24 5 23 21 32 7 30 11 28 27 2 13 36 17 34 33 8 19 6 23 4 ;22 9 2 7 36 5 28 15 8 13 6 11 34 21 14 19 12 17 4 27 20 25 18 23 10 33 26 31 24 29 16 3 32 1 30 35 ;17 16 15 32 13 6 23 22 21 2 19 12 29 28 27 8 25 18 35 34 33 14 31 24 5 4 3 20 1 30 11 10 9 26 7 36 ;30 11 4 21 26 19 36 17 10 27 32 25 6 23 16 33 2 31 12 29 22 3 8 1 18 35 28 9 14 7 24 5 34 15 20 13 ;1 30 29 4 3 26 7 36 35 10 9 32 13 6 5 16 15 2 19 12 11 22 21 8 25 18 17 28 27 14 31 24 23 34 33 20 ;14 7 24 5 34 33 20 13 30 11 4 3 26 19 36 17 10 9 32 25 6 23 16 15 2 31 12 29 22 21 8 1 18 35 28 27 ;9 20 31 18 35 16 15 26 1 24 5 22 21 32 7 30 11 28 27 2 13 36 17 34 33 8 19 6 23 4 3 14 25 12 29 10 ;28 15 8 13 6 11 34 21 14 19 12 17 4 27 20 25 18 23 10 33 26 31 24 29 16 3 32 1 30 35 22 9 2 7 36 5 ;23 22 21 2 19 12 29 28 27 8 25 18 35 34 33 14 31 24 5 4 3 20 1 30 11 10 9 26 7 36 17 16 15 32 13 6 ;36 17 10 27 32 25 6 23 16 33 2 31 12 29 22 3 8 1 18 35 28 9 14 7 24 5 34 15 20 13 30 11 4 21 26 19 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[21 10 24 3 2 1 15 4 8 7 6 20 9 13 12 11 25 14 18 17 16 5 19 23 22 ;22 16 15 19 8 2 21 20 24 13 7 1 25 4 18 12 6 5 9 23 17 11 10 14 3 ;18 12 11 20 4 23 17 16 25 9 3 22 21 5 14 8 2 1 10 19 13 7 6 15 24 ;14 23 17 6 5 19 3 22 11 10 24 8 2 16 15 4 13 7 21 20 9 18 12 1 25 ;25 9 13 7 1 5 14 18 12 6 10 19 23 17 11 15 24 3 22 16 20 4 8 2 21 ;1 15 4 8 7 6 20 9 13 12 11 25 14 18 17 16 5 19 23 22 21 10 24 3 2 ;2 21 20 24 13 7 1 25 4 18 12 6 5 9 23 17 11 10 14 3 22 16 15 19 8 ;23 17 16 25 9 3 22 21 5 14 8 2 1 10 19 13 7 6 15 24 18 12 11 20 4 ;19 3 22 11 10 24 8 2 16 15 4 13 7 21 20 9 18 12 1 25 14 23 17 6 5 ;5 14 18 12 6 10 19 23 17 11 15 24 3 22 16 20 4 8 2 21 25 9 13 7 1 ;6 20 9 13 12 11 25 14 18 17 16 5 19 23 22 21 10 24 3 2 1 15 4 8 7 ;7 1 25 4 18 12 6 5 9 23 17 11 10 14 3 22 16 15 19 8 2 21 20 24 13 ;3 22 21 5 14 8 2 1 10 19 13 7 6 15 24 18 12 11 20 4 23 17 16 25 9 ;24 8 2 16 15 4 13 7 21 20 9 18 12 1 25 14 23 17 6 5 19 3 22 11 10 ;10 19 23 17 11 15 24 3 22 16 20 4 8 2 21 25 9 13 7 1 5 14 18 12 6 ;11 25 14 18 17 16 5 19 23 22 21 10 24 3 2 1 15 4 8 7 6 20 9 13 12 ;12 6 5 9 23 17 11 10 14 3 22 16 15 19 8 2 21 20 24 13 7 1 25 4 18 ;8 2 1 10 19 13 7 6 15 24 18 12 11 20 4 23 17 16 25 9 3 22 21 5 14 ;4 13 7 21 20 9 18 12 1 25 14 23 17 6 5 19 3 22 11 10 24 8 2 16 15 ;15 24 3 22 16 20 4 8 2 21 25 9 13 7 1 5 14 18 12 6 10 19 23 17 11 ;16 5 19 23 22 21 10 24 3 2 1 15 4 8 7 6 20 9 13 12 11 25 14 18 17 ;17 11 10 14 3 22 16 15 19 8 2 21 20 24 13 7 1 25 4 18 12 6 5 9 23 ;13 7 6 15 24 18 12 11 20 4 23 17 16 25 9 3 22 21 5 14 8 2 1 10 19 ;9 18 12 1 25 14 23 17 6 5 19 3 22 11 10 24 8 2 16 15 4 13 7 21 20 ;20 4 8 2 21 25 9 13 7 1 5 14 18 12 6 10 19 23 17 11 15 24 3 22 16 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[19 6 23 10 21 8 25 12 29 16 27 14 31 18 35 22 33 20 1 24 5 28 3 26 7 30 11 34 9 32 13 36 17 4 15 2 ;14 25 30 35 28 15 20 31 36 5 34 21 26 1 6 11 4 27 32 7 12 17 10 33 2 13 18 23 16 3 8 19 24 29 22 9 ;3 26 13 12 11 34 9 32 19 18 17 4 15 2 25 24 23 10 21 8 31 30 29 16 27 14 1 36 35 22 33 20 7 6 5 28 ;16 33 32 7 24 17 22 3 2 13 30 23 28 9 8 19 36 29 34 15 14 25 6 35 4 21 20 31 12 5 10 27 26 1 18 11 ;29 4 27 20 31 18 35 10 33 26 1 24 5 16 3 32 7 30 11 22 9 2 13 36 17 28 15 8 19 6 23 34 21 14 25 12 ;36 5 22 9 2 1 6 11 28 15 8 7 12 17 34 21 14 13 18 23 4 27 20 19 24 29 10 33 26 25 30 35 16 3 32 31 ;25 12 29 16 27 14 31 18 35 22 33 20 1 24 5 28 3 26 7 30 11 34 9 32 13 36 17 4 15 2 19 6 23 10 21 8 ;20 31 36 5 34 21 26 1 6 11 4 27 32 7 12 17 10 33 2 13 18 23 16 3 8 19 24 29 22 9 14 25 30 35 28 15 ;9 32 19 18 17 4 15 2 25 24 23 10 21 8 31 30 29 16 27 14 1 36 35 22 33 20 7 6 5 28 3 26 13 12 11 34 ;22 3 2 13 30 23 28 9 8 19 36 29 34 15 14 25 6 35 4 21 20 31 12 5 10 27 26 1 18 11 16 33 32 7 24 17 ;35 10 33 26 1 24 5 16 3 32 7 30 11 22 9 2 13 36 17 28 15 8 19 6 23 34 21 14 25 12 29 4 27 20 31 18 ;6 11 28 15 8 7 12 17 34 21 14 13 18 23 4 27 20 19 24 29 10 33 26 25 30 35 16 3 32 31 36 5 22 9 2 1 ;31 18 35 22 33 20 1 24 5 28 3 26 7 30 11 34 9 32 13 36 17 4 15 2 19 6 23 10 21 8 25 12 29 16 27 14 ;26 1 6 11 4 27 32 7 12 17 10 33 2 13 18 23 16 3 8 19 24 29 22 9 14 25 30 35 28 15 20 31 36 5 34 21 ;15 2 25 24 23 10 21 8 31 30 29 16 27 14 1 36 35 22 33 20 7 6 5 28 3 26 13 12 11 34 9 32 19 18 17 4 ;28 9 8 19 36 29 34 15 14 25 6 35 4 21 20 31 12 5 10 27 26 1 18 11 16 33 32 7 24 17 22 3 2 13 30 23 ;5 16 3 32 7 30 11 22 9 2 13 36 17 28 15 8 19 6 23 34 21 14 25 12 29 4 27 20 31 18 35 10 33 26 1 24 ;12 17 34 21 14 13 18 23 4 27 20 19 24 29 10 33 26 25 30 35 16 3 32 31 36 5 22 9 2 1 6 11 28 15 8 7 ;1 24 5 28 3 26 7 30 11 34 9 32 13 36 17 4 15 2 19 6 23 10 21 8 25 12 29 16 27 14 31 18 35 22 33 20 ;32 7 12 17 10 33 2 13 18 23 16 3 8 19 24 29 22 9 14 25 30 35 28 15 20 31 36 5 34 21 26 1 6 11 4 27 ;21 8 31 30 29 16 27 14 1 36 35 22 33 20 7 6 5 28 3 26 13 12 11 34 9 32 19 18 17 4 15 2 25 24 23 10 ;34 15 14 25 6 35 4 21 20 31 12 5 10 27 26 1 18 11 16 33 32 7 24 17 22 3 2 13 30 23 28 9 8 19 36 29 ;11 22 9 2 13 36 17 28 15 8 19 6 23 34 21 14 25 12 29 4 27 20 31 18 35 10 33 26 1 24 5 16 3 32 7 30 ;18 23 4 27 20 19 24 29 10 33 26 25 30 35 16 3 32 31 36 5 22 9 2 1 6 11 28 15 8 7 12 17 34 21 14 13 ;7 30 11 34 9 32 13 36 17 4 15 2 19 6 23 10 21 8 25 12 29 16 27 14 31 18 35 22 33 20 1 24 5 28 3 26 ;2 13 18 23 16 3 8 19 24 29 22 9 14 25 30 35 28 15 20 31 36 5 34 21 26 1 6 11 4 27 32 7 12 17 10 33 ;27 14 1 36 35 22 33 20 7 6 5 28 3 26 13 12 11 34 9 32 19 18 17 4 15 2 25 24 23 10 21 8 31 30 29 16 ;4 21 20 31 12 5 10 27 26 1 18 11 16 33 32 7 24 17 22 3 2 13 30 23 28 9 8 19 36 29 34 15 14 25 6 35 ;17 28 15 8 19 6 23 34 21 14 25 12 29 4 27 20 31 18 35 10 33 26 1 24 5 16 3 32 7 30 11 22 9 2 13 36 ;24 29 10 33 26 25 30 35 16 3 32 31 36 5 22 9 2 1 6 11 28 15 8 7 12 17 34 21 14 13 18 23 4 27 20 19 ;13 36 17 4 15 2 19 6 23 10 21 8 25 12 29 16 27 14 31 18 35 22 33 20 1 24 5 28 3 26 7 30 11 34 9 32 ;8 19 24 29 22 9 14 25 30 35 28 15 20 31 36 5 34 21 26 1 6 11 4 27 32 7 12 17 10 33 2 13 18 23 16 3 ;33 20 7 6 5 28 3 26 13 12 11 34 9 32 19 18 17 4 15 2 25 24 23 10 21 8 31 30 29 16 27 14 1 36 35 22 ;10 27 26 1 18 11 16 33 32 7 24 17 22 3 2 13 30 23 28 9 8 19 36 29 34 15 14 25 6 35 4 21 20 31 12 5 ;23 34 21 14 25 12 29 4 27 20 31 18 35 10 33 26 1 24 5 16 3 32 7 30 11 22 9 2 13 36 17 28 15 8 19 6 ;30 35 16 3 32 31 36 5 22 9 2 1 6 11 28 15 8 7 12 17 34 21 14 13 18 23 4 27 20 19 24 29 10 33 26 25 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ;18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 ;19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 19 18 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[7 6 8 1 9 2 4 3 5 ;2 1 3 5 4 6 8 7 9 ;9 5 4 3 8 7 6 2 1 ;1 9 2 4 3 5 7 6 8 ;5 4 6 8 7 9 2 1 3 ;3 8 7 6 2 1 9 5 4 ;4 3 5 7 6 8 1 9 2 ;8 7 9 2 1 3 5 4 6 ;6 2 1 9 5 4 3 8 7 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 18 5 28 3 14 7 24 11 34 9 20 13 30 17 4 15 26 19 36 23 10 21 32 25 6 29 16 27 2 31 12 35 22 33 8 ;8 25 6 29 4 33 14 31 12 35 10 3 20 1 18 5 16 9 26 7 24 11 22 15 32 13 30 17 28 21 2 19 36 23 34 27 ;21 32 19 24 17 22 27 2 25 30 23 28 33 8 31 36 29 34 3 14 1 6 35 4 9 20 7 12 5 10 15 26 13 18 11 16 ;34 15 26 31 12 11 4 21 32 1 18 17 10 27 2 7 24 23 16 33 8 13 30 29 22 3 14 19 36 35 28 9 20 25 6 5 ;23 16 27 2 13 30 29 22 33 8 19 36 35 28 3 14 25 6 5 34 9 20 31 12 11 4 15 26 1 18 17 10 21 32 7 24 ;36 35 10 9 20 7 6 5 16 15 26 13 12 11 22 21 32 19 18 17 28 27 2 25 24 23 34 33 8 31 30 29 4 3 14 1 ;7 24 11 34 9 20 13 30 17 4 15 26 19 36 23 10 21 32 25 6 29 16 27 2 31 12 35 22 33 8 1 18 5 28 3 14 ;14 31 12 35 10 3 20 1 18 5 16 9 26 7 24 11 22 15 32 13 30 17 28 21 2 19 36 23 34 27 8 25 6 29 4 33 ;27 2 25 30 23 28 33 8 31 36 29 34 3 14 1 6 35 4 9 20 7 12 5 10 15 26 13 18 11 16 21 32 19 24 17 22 ;4 21 32 1 18 17 10 27 2 7 24 23 16 33 8 13 30 29 22 3 14 19 36 35 28 9 20 25 6 5 34 15 26 31 12 11 ;29 22 33 8 19 36 35 28 3 14 25 6 5 34 9 20 31 12 11 4 15 26 1 18 17 10 21 32 7 24 23 16 27 2 13 30 ;6 5 16 15 26 13 12 11 22 21 32 19 18 17 28 27 2 25 24 23 34 33 8 31 30 29 4 3 14 1 36 35 10 9 20 7 ;13 30 17 4 15 26 19 36 23 10 21 32 25 6 29 16 27 2 31 12 35 22 33 8 1 18 5 28 3 14 7 24 11 34 9 20 ;20 1 18 5 16 9 26 7 24 11 22 15 32 13 30 17 28 21 2 19 36 23 34 27 8 25 6 29 4 33 14 31 12 35 10 3 ;33 8 31 36 29 34 3 14 1 6 35 4 9 20 7 12 5 10 15 26 13 18 11 16 21 32 19 24 17 22 27 2 25 30 23 28 ;10 27 2 7 24 23 16 33 8 13 30 29 22 3 14 19 36 35 28 9 20 25 6 5 34 15 26 31 12 11 4 21 32 1 18 17 ;35 28 3 14 25 6 5 34 9 20 31 12 11 4 15 26 1 18 17 10 21 32 7 24 23 16 27 2 13 30 29 22 33 8 19 36 ;12 11 22 21 32 19 18 17 28 27 2 25 24 23 34 33 8 31 30 29 4 3 14 1 36 35 10 9 20 7 6 5 16 15 26 13 ;19 36 23 10 21 32 25 6 29 16 27 2 31 12 35 22 33 8 1 18 5 28 3 14 7 24 11 34 9 20 13 30 17 4 15 26 ;26 7 24 11 22 15 32 13 30 17 28 21 2 19 36 23 34 27 8 25 6 29 4 33 14 31 12 35 10 3 20 1 18 5 16 9 ;3 14 1 6 35 4 9 20 7 12 5 10 15 26 13 18 11 16 21 32 19 24 17 22 27 2 25 30 23 28 33 8 31 36 29 34 ;16 33 8 13 30 29 22 3 14 19 36 35 28 9 20 25 6 5 34 15 26 31 12 11 4 21 32 1 18 17 10 27 2 7 24 23 ;5 34 9 20 31 12 11 4 15 26 1 18 17 10 21 32 7 24 23 16 27 2 13 30 29 22 33 8 19 36 35 28 3 14 25 6 ;18 17 28 27 2 25 24 23 34 33 8 31 30 29 4 3 14 1 36 35 10 9 20 7 6 5 16 15 26 13 12 11 22 21 32 19 ;25 6 29 16 27 2 31 12 35 22 33 8 1 18 5 28 3 14 7 24 11 34 9 20 13 30 17 4 15 26 19 36 23 10 21 32 ;32 13 30 17 28 21 2 19 36 23 34 27 8 25 6 29 4 33 14 31 12 35 10 3 20 1 18 5 16 9 26 7 24 11 22 15 ;9 20 7 12 5 10 15 26 13 18 11 16 21 32 19 24 17 22 27 2 25 30 23 28 33 8 31 36 29 34 3 14 1 6 35 4 ;22 3 14 19 36 35 28 9 20 25 6 5 34 15 26 31 12 11 4 21 32 1 18 17 10 27 2 7 24 23 16 33 8 13 30 29 ;11 4 15 26 1 18 17 10 21 32 7 24 23 16 27 2 13 30 29 22 33 8 19 36 35 28 3 14 25 6 5 34 9 20 31 12 ;24 23 34 33 8 31 30 29 4 3 14 1 36 35 10 9 20 7 6 5 16 15 26 13 12 11 22 21 32 19 18 17 28 27 2 25 ;31 12 35 22 33 8 1 18 5 28 3 14 7 24 11 34 9 20 13 30 17 4 15 26 19 36 23 10 21 32 25 6 29 16 27 2 ;2 19 36 23 34 27 8 25 6 29 4 33 14 31 12 35 10 3 20 1 18 5 16 9 26 7 24 11 22 15 32 13 30 17 28 21 ;15 26 13 18 11 16 21 32 19 24 17 22 27 2 25 30 23 28 33 8 31 36 29 34 3 14 1 6 35 4 9 20 7 12 5 10 ;28 9 20 25 6 5 34 15 26 31 12 11 4 21 32 1 18 17 10 27 2 7 24 23 16 33 8 13 30 29 22 3 14 19 36 35 ;17 10 21 32 7 24 23 16 27 2 13 30 29 22 33 8 19 36 35 28 3 14 25 6 5 34 9 20 31 12 11 4 15 26 1 18 ;30 29 4 3 14 1 36 35 10 9 20 7 6 5 16 15 26 13 12 11 22 21 32 19 18 17 28 27 2 25 24 23 34 33 8 31 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[9 16 3 10 13 4 7 14 1 8 11 2 5 12 15 6 ;2 13 4 15 6 1 8 3 10 5 12 7 14 9 16 11 ;7 6 1 12 11 10 5 16 15 14 9 4 3 2 13 8 ;8 11 14 5 12 15 2 9 16 3 6 13 4 7 10 1 ;13 4 7 14 1 8 11 2 5 12 15 6 9 16 3 10 ;6 1 8 3 10 5 12 7 14 9 16 11 2 13 4 15 ;11 10 5 16 15 14 9 4 3 2 13 8 7 6 1 12 ;12 15 2 9 16 3 6 13 4 7 10 1 8 11 14 5 ;1 8 11 2 5 12 15 6 9 16 3 10 13 4 7 14 ;10 5 12 7 14 9 16 11 2 13 4 15 6 1 8 3 ;15 14 9 4 3 2 13 8 7 6 1 12 11 10 5 16 ;16 3 6 13 4 7 10 1 8 11 14 5 12 15 2 9 ;5 12 15 6 9 16 3 10 13 4 7 14 1 8 11 2 ;14 9 16 11 2 13 4 15 6 1 8 3 10 5 12 7 ;3 2 13 8 7 6 1 12 11 10 5 16 15 14 9 4 ;4 7 10 1 8 11 14 5 12 15 2 9 16 3 6 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 20 9 13 12 6 25 14 18 17 11 5 19 23 22 16 10 24 3 2 21 15 4 8 7 ;22 11 5 14 8 2 16 10 19 13 7 21 15 24 18 12 1 20 4 23 17 6 25 9 3 ;3 2 21 25 19 8 7 1 5 24 13 12 6 10 4 18 17 11 15 9 23 22 16 20 14 ;4 23 17 16 15 9 3 22 21 20 14 8 2 1 25 19 13 7 6 5 24 18 12 11 10 ;10 24 18 7 6 15 4 23 12 11 20 9 3 17 16 25 14 8 22 21 5 19 13 2 1 ;6 25 14 18 17 11 5 19 23 22 16 10 24 3 2 21 15 4 8 7 1 20 9 13 12 ;2 16 10 19 13 7 21 15 24 18 12 1 20 4 23 17 6 25 9 3 22 11 5 14 8 ;8 7 1 5 24 13 12 6 10 4 18 17 11 15 9 23 22 16 20 14 3 2 21 25 19 ;9 3 22 21 20 14 8 2 1 25 19 13 7 6 5 24 18 12 11 10 4 23 17 16 15 ;15 4 23 12 11 20 9 3 17 16 25 14 8 22 21 5 19 13 2 1 10 24 18 7 6 ;11 5 19 23 22 16 10 24 3 2 21 15 4 8 7 1 20 9 13 12 6 25 14 18 17 ;7 21 15 24 18 12 1 20 4 23 17 6 25 9 3 22 11 5 14 8 2 16 10 19 13 ;13 12 6 10 4 18 17 11 15 9 23 22 16 20 14 3 2 21 25 19 8 7 1 5 24 ;14 8 2 1 25 19 13 7 6 5 24 18 12 11 10 4 23 17 16 15 9 3 22 21 20 ;20 9 3 17 16 25 14 8 22 21 5 19 13 2 1 10 24 18 7 6 15 4 23 12 11 ;16 10 24 3 2 21 15 4 8 7 1 20 9 13 12 6 25 14 18 17 11 5 19 23 22 ;12 1 20 4 23 17 6 25 9 3 22 11 5 14 8 2 16 10 19 13 7 21 15 24 18 ;18 17 11 15 9 23 22 16 20 14 3 2 21 25 19 8 7 1 5 24 13 12 6 10 4 ;19 13 7 6 5 24 18 12 11 10 4 23 17 16 15 9 3 22 21 20 14 8 2 1 25 ;25 14 8 22 21 5 19 13 2 1 10 24 18 7 6 15 4 23 12 11 20 9 3 17 16 ;21 15 4 8 7 1 20 9 13 12 6 25 14 18 17 11 5 19 23 22 16 10 24 3 2 ;17 6 25 9 3 22 11 5 14 8 2 16 10 19 13 7 21 15 24 18 12 1 20 4 23 ;23 22 16 20 14 3 2 21 25 19 8 7 1 5 24 13 12 6 10 4 18 17 11 15 9 ;24 18 12 11 10 4 23 17 16 15 9 3 22 21 20 14 8 2 1 25 19 13 7 6 5 ;5 19 13 2 1 10 24 18 7 6 15 4 23 12 11 20 9 3 17 16 25 14 8 22 21 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[13 8 15 6 1 12 3 10 5 16 7 14 9 4 11 2 ;14 5 4 3 2 9 8 7 6 13 12 11 10 1 16 15 ;7 2 9 12 11 6 13 16 15 10 1 4 3 14 5 8 ;16 11 10 1 4 15 14 5 8 3 2 9 12 7 6 13 ;1 12 3 10 5 16 7 14 9 4 11 2 13 8 15 6 ;2 9 8 7 6 13 12 11 10 1 16 15 14 5 4 3 ;11 6 13 16 15 10 1 4 3 14 5 8 7 2 9 12 ;4 15 14 5 8 3 2 9 12 7 6 13 16 11 10 1 ;5 16 7 14 9 4 11 2 13 8 15 6 1 12 3 10 ;6 13 12 11 10 1 16 15 14 5 4 3 2 9 8 7 ;15 10 1 4 3 14 5 8 7 2 10 12 11 6 13 16 ;8 3 2 9 12 7 6 13 16 11 10 1 4 15 14 5 ;9 4 11 2 13 8 15 6 1 12 3 10 5 16 7 14 ;10 1 16 15 14 5 4 3 2 9 8 7 6 13 12 11 ;3 14 5 8 7 2 9 12 11 6 13 16 15 10 1 4 ;12 7 6 13 16 11 10 1 4 15 14 5 8 3 2 9 ];\r\nvexp=0\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[21 25 24 13 17 1 5 4 18 22 6 10 9 23 2 11 15 14 3 7 16 20 19 8 12 ;7 16 10 14 23 12 21 15 19 3 17 1 20 24 8 22 6 25 4 13 2 11 5 9 18 ;8 12 6 15 9 13 17 11 20 14 18 22 16 25 19 23 2 21 5 24 3 7 1 10 4 ;19 3 22 1 5 24 8 2 6 10 4 13 7 11 15 9 18 12 16 20 14 23 17 21 25 ;20 4 18 2 11 25 9 23 7 16 5 14 3 12 21 10 19 8 17 1 15 24 13 22 6 ;1 5 4 18 22 6 10 9 23 2 11 15 14 3 7 16 20 19 8 12 21 25 24 13 17 ;12 21 15 19 3 17 1 20 24 8 22 6 25 4 13 2 11 5 9 18 7 16 10 14 23 ;13 17 11 20 14 18 22 16 25 19 23 2 21 5 24 3 7 1 10 4 8 12 6 15 9 ;24 8 2 6 10 4 13 7 11 15 9 18 12 16 20 14 23 17 21 25 19 3 22 1 5 ;25 9 23 7 16 5 14 3 12 21 10 19 8 17 1 15 24 13 22 6 20 4 18 2 11 ;6 10 9 23 2 11 15 14 3 7 16 20 19 8 12 21 25 24 13 17 1 5 4 18 22 ;17 1 20 24 8 22 6 25 4 13 2 11 5 9 18 7 16 10 14 23 12 21 15 19 3 ;18 22 16 25 19 23 2 21 5 24 3 7 1 10 4 8 12 6 15 9 13 17 11 20 14 ;4 13 7 11 15 9 18 12 16 20 14 23 17 21 25 19 3 22 1 5 24 8 2 6 10 ;5 14 3 12 21 10 19 8 17 1 15 24 13 22 6 20 4 18 2 11 25 9 23 7 16 ;11 15 14 3 7 16 20 19 8 12 21 25 24 13 17 1 5 4 18 22 6 10 9 23 2 ;22 6 25 4 13 2 11 5 9 18 7 16 10 14 23 12 21 15 19 3 17 1 20 24 8 ;23 2 21 5 24 3 7 1 10 4 8 12 6 15 9 13 17 11 20 14 18 22 16 25 19 ;9 18 12 16 20 14 23 17 21 25 19 3 22 1 5 24 8 2 6 10 4 13 7 11 15 ;10 19 8 17 1 15 24 13 22 6 20 4 18 2 11 25 9 23 7 16 5 14 3 12 21 ;16 20 19 8 12 21 25 24 13 17 1 5 4 18 22 6 10 9 23 2 11 15 14 3 7 ;2 11 5 9 18 7 16 10 14 23 12 21 15 19 3 17 1 20 24 8 22 6 25 4 13 ;3 7 1 10 4 8 12 6 15 9 13 17 11 20 14 18 22 16 25 19 23 2 21 5 24 ;14 23 17 21 25 19 3 22 1 5 24 8 2 6 10 4 13 7 11 15 9 18 12 16 20 ;15 24 13 22 6 20 4 18 2 11 25 9 23 7 16 5 14 3 12 21 10 19 8 17 1 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[9 8 7 6 13 12 11 10 1 16 15 14 5 4 3 2 ;14 1 4 11 2 5 8 15 6 9 12 3 10 13 16 7 ;3 2 5 16 7 6 9 4 11 10 13 8 15 14 1 12 ;12 15 10 13 16 3 14 1 4 7 2 5 8 11 6 9 ;13 12 11 10 1 16 15 14 5 4 3 2 9 8 7 6 ;2 5 8 15 6 9 12 3 10 13 16 7 14 1 4 11 ;7 6 9 4 11 10 13 8 15 14 1 12 3 2 5 16 ;16 3 14 1 4 7 2 5 8 11 6 9 12 15 10 13 ;1 16 15 14 5 4 3 2 9 8 7 6 13 12 11 10 ;6 9 12 3 10 13 16 7 14 1 4 11 2 5 8 15 ;11 10 13 8 15 14 1 12 3 2 5 16 7 6 9 4 ;4 7 2 5 8 11 6 9 12 15 10 13 16 3 14 1 ;5 4 3 2 9 8 7 6 13 12 11 10 1 16 15 14 ;10 13 16 7 14 1 4 11 2 5 8 15 6 9 12 3 ;15 14 1 12 3 2 5 16 7 6 9 4 11 10 13 8 ;8 11 6 9 12 15 10 13 16 3 14 1 4 7 2 5 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))\r\n%%\r\nzm=[1 6 17 4 33 2 7 12 23 10 3 8 13 18 29 16 9 14 19 24 35 22 15 20 25 30 5 28 21 26 31 36 11 34 27 32 ;8 19 12 29 10 15 14 25 18 35 16 21 20 31 24 5 22 27 26 1 30 11 28 33 32 7 36 17 34 3 2 13 6 23 4 9 ;9 26 7 18 23 28 15 32 13 24 29 34 21 2 19 30 35 4 27 8 25 36 5 10 33 14 31 6 11 16 3 20 1 12 17 22 ;16 27 32 31 30 11 22 33 2 1 36 17 28 3 8 7 6 23 34 9 14 13 12 29 4 15 20 19 18 35 10 21 26 25 24 5 ;35 34 3 20 13 24 5 4 9 26 19 30 11 10 15 32 25 36 17 16 21 2 31 6 23 22 27 8 1 12 29 28 33 14 7 18 ;36 5 22 21 14 25 6 11 28 27 20 31 12 17 34 33 26 1 18 23 4 3 32 7 24 29 10 9 2 13 30 35 16 15 8 19 ;7 12 23 10 3 8 13 18 29 16 9 14 19 24 35 22 15 20 25 30 5 28 21 26 31 36 11 34 27 32 1 6 17 4 33 2 ;14 25 18 35 16 21 20 31 24 5 22 27 26 1 30 11 28 33 32 7 36 17 34 3 2 13 6 23 4 9 8 19 12 29 10 15 ;15 32 13 24 29 34 21 2 19 30 35 4 27 8 25 36 5 10 33 14 31 6 11 16 3 20 1 12 17 22 9 26 7 18 23 28 ;22 33 2 1 36 17 28 3 8 7 6 23 34 9 14 13 12 29 4 15 20 19 18 35 10 21 26 25 24 5 16 27 32 31 30 11 ;5 4 9 26 19 30 11 10 15 32 25 36 17 16 21 2 31 6 23 22 27 8 1 12 29 28 33 14 7 18 35 34 3 20 13 24 ;6 11 28 27 20 31 12 17 34 33 26 1 18 23 4 3 32 7 24 29 10 9 2 13 30 35 16 15 8 19 36 5 22 21 14 25 ;13 18 29 16 9 14 19 24 35 22 15 20 25 30 5 28 21 26 31 36 11 34 27 32 1 6 17 4 33 2 7 12 23 10 3 8 ;20 31 24 5 22 27 26 1 30 11 28 33 32 7 36 17 34 3 2 13 6 23 4 9 8 19 12 29 10 15 14 25 18 35 16 21 ;21 2 19 30 35 4 27 8 25 36 5 10 33 14 31 6 11 16 3 20 1 12 17 22 9 26 7 18 23 28 15 32 13 24 29 34 ;28 3 8 7 6 23 34 9 14 13 12 29 4 15 20 19 18 35 10 21 26 25 24 5 16 27 32 31 30 11 22 33 2 1 36 17 ;11 10 15 32 25 36 17 16 21 2 31 6 23 22 27 8 1 12 29 28 33 14 7 18 35 34 3 20 13 24 5 4 9 26 19 30 ;12 17 34 33 26 1 18 23 4 3 32 7 24 29 10 9 2 13 30 35 16 15 8 19 36 5 22 21 14 25 6 11 28 27 20 31 ;19 24 35 22 15 20 25 30 5 28 21 26 31 36 11 34 27 32 1 6 17 4 33 2 7 12 23 10 3 8 13 18 29 16 9 14 ;26 1 30 11 28 33 32 7 36 17 34 3 2 13 6 23 4 9 8 19 12 29 10 15 14 25 18 35 16 21 20 31 24 5 22 27 ;27 8 25 36 5 10 33 14 31 6 11 16 3 20 1 12 17 22 9 26 7 18 23 28 15 32 13 24 29 34 21 2 19 30 35 4 ;34 9 14 13 12 29 4 15 20 19 18 35 10 21 26 25 24 5 16 27 32 31 30 11 22 33 2 1 36 17 28 3 8 7 6 23 ;17 16 21 2 31 6 23 22 27 8 1 12 29 28 33 14 7 18 35 34 3 20 13 24 5 4 9 26 19 30 11 10 15 32 25 36 ;18 23 4 3 32 7 24 29 10 9 2 13 30 35 16 15 8 19 36 5 22 21 14 25 6 11 28 27 20 31 12 17 34 33 26 1 ;25 30 5 28 21 26 31 36 11 34 27 32 1 6 17 4 33 2 7 12 23 10 3 8 13 18 29 16 9 14 19 24 35 22 15 20 ;32 7 36 17 34 3 2 13 6 23 4 9 8 19 12 29 10 15 14 25 18 35 16 21 20 31 24 5 22 27 26 1 30 11 28 33 ;33 14 31 6 11 16 3 20 1 12 17 22 9 26 7 18 23 28 15 32 13 24 29 34 21 2 19 30 35 4 27 8 25 36 5 10 ;4 15 20 19 18 35 10 21 26 25 24 5 16 27 32 31 30 11 22 33 2 1 36 17 28 3 8 7 6 23 34 9 14 13 12 29 ;23 22 27 8 1 12 29 28 33 14 7 18 35 34 3 20 13 24 5 4 9 26 19 30 11 10 15 32 25 36 17 16 21 2 31 6 ;24 29 10 9 2 13 30 35 16 15 8 19 36 5 22 21 14 25 6 11 28 27 20 31 12 17 34 33 26 1 18 23 4 3 32 7 ;31 36 11 34 27 32 1 6 17 4 33 2 7 12 23 10 3 8 13 18 29 16 9 14 19 24 35 22 15 20 25 30 5 28 21 26 ;2 13 6 23 4 9 8 19 12 29 10 15 14 25 18 35 16 21 20 31 24 5 22 27 26 1 30 11 28 33 32 7 36 17 34 3 ;3 20 1 12 17 22 9 26 7 18 23 28 15 32 13 24 29 34 21 2 19 30 35 4 27 8 25 36 5 10 33 14 31 6 11 16 ;10 21 26 25 24 5 16 27 32 31 30 11 22 33 2 1 36 17 28 3 8 7 6 23 34 9 14 13 12 29 4 15 20 19 18 35 ;29 28 33 14 7 18 35 34 3 20 13 24 5 4 9 26 19 30 11 10 15 32 25 36 17 16 21 2 31 6 23 22 27 8 1 12 ;30 35 16 15 8 19 36 5 22 21 14 25 6 11 28 27 20 31 12 17 34 33 26 1 18 23 4 3 32 7 24 29 10 9 2 13 ];\r\nvexp=1\r\nv=Sudoku_CH(zm);\r\nassert(isequal(v,vexp))","published":true,"deleted":false,"likes_count":4,"comments_count":1,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":66,"test_suite_updated_at":"2013-10-14T05:18:15.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2013-10-14T02:09:35.000Z","updated_at":"2025-12-15T20:06:09.000Z","published_at":"2013-10-14T02:26:56.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThis Challenge is derived from\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://code.google.com/codejam/contest/2929486/dashboard#s=p0\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGJam 2014 China Sudoku\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Large Case.\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 Goal is determine if the Sudoku square is valid. Each row and column must contain 1:N, for an NxN matix. Nroot=N^.5. Each NrootxNroot block must contain 1:N where blocks start at [1,1+Nroot,...] in Row/Col.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e [M], NxN matrix (3^2\u0026lt;=N\u0026lt;=6^2)\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e TF, 1=Valid, 0=Invalid\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExamples:\u003c/w:t\u003e\u003c/w:r\u003e\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[TF=1\\n5 3 4 6 7 8 9 1 2\\n6 7 2 1 9 5 3 4 8\\n1 9 8 3 4 2 5 6 7\\n8 5 9 7 6 1 4 2 3\\n4 2 6 8 5 3 7 9 1\\n7 1 3 9 2 4 8 5 6\\n9 6 1 5 3 7 2 8 4\\n2 8 7 4 1 9 6 3 5\\n3 4 5 2 8 6 1 7 9\\n\\nTF=0\\n5 3 4 6 7 8 9 1 2\\n6 7 2 1 9 5 3 4 8\\n1 9 8 3 4 2 5 6 7\\n8 5 9 7 6 1 4 2 3\\n4 2 6 8 999 3 7 9 1\\n7 1 3 9 2 4 8 5 6\\n9 6 1 5 3 7 2 8 4\\n2 8 7 4 1 9 6 3 5\\n3 4 5 2 8 6 1 7 9]]\u003e\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eContest Performance:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Best Delta Time of 7 minutes with 1146 of 2010 able to process the large data set.\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":2085,"title":"Sudoku Solver - Standard 9x9","description":"Solve a Standard 9x9 \u003chttp://en.wikipedia.org/wiki/Sudoku Sudoku\u003e. Values 1 thru 9 occur in each row, column, and the nine non-overlapping 3x3 matrices starting at the top left corner. \u003chttp://www.free-sudoku.com/sudoku.php?dchoix=evil Sudoku practice site\u003e.\r\n\r\n*Input:* m, a 9x9 matrix of values 0 thru 9. Unknowns are 0s.\r\n\r\n*Output:* mout, a 9x9 matrix of values 1 thru 9 that satisfy Sudoku rules.\r\n\r\n*Scoring:* Time (msec) to solve the Hard Sudoku\r\n\r\n*Example:*\r\n\r\n  m         mout\r\n  390701506 398721546\r\n  042890701 542896731\r\n  106540890 176543892\r\n  820600150 829674153\r\n  400138009 457138269\r\n  031002087 631952487\r\n  065087304 965287314\r\n  703065920 713465928\r\n  204309075 284319675\r\n\r\n*Sudoku Variations:*\r\n\r\nFuture challenges will involve the Sudoku variations Diagonal, Arrow(Sums), Inequality, Irregular, and others as they present themselves.\r\n\r\n*Algorithm Spoiler:*\r\nSudoku's can be readily solved using minimal choice recursion with consistency check. A key step is an index map of all indices that have mutual value exclusion (row,col,3x3), idxmap[81,27]. Another key step is to have an Evolve function that implements all single option values determined by the idxmap. A critical performance enhancement is a Sudoku Consistency Checker that checks for illegal replications of values. Illegal placements by Evolve occur when an incorrect value is asserted into the matrix during recursion trials. The recursive solver finds an idx with minimum options based on idxmap. The values for the idx location are asserted, Evolved, Consistency Checked, and then recursion call if Consistent. When all is Consistent and no unknowns remain the Sudoku is solved. Solution times are in the milli-seconds even for Evil, minimum 17 value, Sudokus.","description_html":"\u003cp\u003eSolve a Standard 9x9 \u003ca href = \"http://en.wikipedia.org/wiki/Sudoku\"\u003eSudoku\u003c/a\u003e. Values 1 thru 9 occur in each row, column, and the nine non-overlapping 3x3 matrices starting at the top left corner. \u003ca href = \"http://www.free-sudoku.com/sudoku.php?dchoix=evil\"\u003eSudoku practice site\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e m, a 9x9 matrix of values 0 thru 9. Unknowns are 0s.\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e mout, a 9x9 matrix of values 1 thru 9 that satisfy Sudoku rules.\u003c/p\u003e\u003cp\u003e\u003cb\u003eScoring:\u003c/b\u003e Time (msec) to solve the Hard Sudoku\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003em         mout\r\n390701506 398721546\r\n042890701 542896731\r\n106540890 176543892\r\n820600150 829674153\r\n400138009 457138269\r\n031002087 631952487\r\n065087304 965287314\r\n703065920 713465928\r\n204309075 284319675\r\n\u003c/pre\u003e\u003cp\u003e\u003cb\u003eSudoku Variations:\u003c/b\u003e\u003c/p\u003e\u003cp\u003eFuture challenges will involve the Sudoku variations Diagonal, Arrow(Sums), Inequality, Irregular, and others as they present themselves.\u003c/p\u003e\u003cp\u003e\u003cb\u003eAlgorithm Spoiler:\u003c/b\u003e\r\nSudoku's can be readily solved using minimal choice recursion with consistency check. A key step is an index map of all indices that have mutual value exclusion (row,col,3x3), idxmap[81,27]. Another key step is to have an Evolve function that implements all single option values determined by the idxmap. A critical performance enhancement is a Sudoku Consistency Checker that checks for illegal replications of values. Illegal placements by Evolve occur when an incorrect value is asserted into the matrix during recursion trials. The recursive solver finds an idx with minimum options based on idxmap. The values for the idx location are asserted, Evolved, Consistency Checked, and then recursion call if Consistent. When all is Consistent and no unknowns remain the Sudoku is solved. Solution times are in the milli-seconds even for Evil, minimum 17 value, Sudokus.\u003c/p\u003e","function_template":"function mout=sudoku_solver(m)\r\n% m is a 9x9 Sudoku array with 0 for unknown values\r\n% create mout a consistent sudoku array\r\n  mout=m;\r\nend","test_suite":"assignin('caller','score',500);\r\n%%\r\n% Test 1\r\nmstr=['012300007'; '040600010'; '078900020'; '000000040'; '100000002'; '060000000'; '080001230'; '090004060'; '300007890']; \r\n% convert string to array\r\nm=zeros(9);\r\nfor i=1:9\r\n m(i,:)=mstr(i,:)-'0'  ; \r\nend\r\n\r\ntic\r\nmout=sudoku_solver(m)\r\ntoc\r\n\r\nvalid=all(arrayfun(@(i) all(sum([mout mout']==i)),1:length(mout)));\r\nassert(valid==1)\r\n\r\nptr=find(m\u003e0);\r\nvalid2=isequal(m(ptr),mout(ptr));\r\nassert(valid2==1)\r\n\r\n%%\r\n% Test 2\r\nmstr=['000004500'; '000003600'; '432008700'; '867000000'; '000000000'; '000000417'; '001900854'; '006400000'; '003700000']; \r\n% convert string to array\r\nm=zeros(9);\r\nfor i=1:9\r\n m(i,:)=mstr(i,:)-'0'  ; \r\nend\r\n\r\ntic\r\nmout=sudoku_solver(m)\r\ntoc\r\n\r\nvalid=all(arrayfun(@(i) all(sum([mout mout']==i)),1:length(mout)));\r\nassert(valid==1)\r\n\r\nptr=find(m\u003e0);\r\nvalid2=isequal(m(ptr),mout(ptr));\r\nassert(valid2==1)\r\n\r\n%%\r\n% Test 3\r\nmstr=['120034000'; '000000056'; '000200000'; '007800002'; '600000001'; '500006300'; '000008000'; '340000000'; '000560078']; \r\n% convert string to array\r\nm=zeros(9);\r\nfor i=1:9\r\n m(i,:)=mstr(i,:)-'0'  ; \r\nend\r\n\r\ntic\r\nmout=sudoku_solver(m)\r\ntoc\r\n\r\nvalid=all(arrayfun(@(i) all(sum([mout mout']==i)),1:length(mout)));\r\nassert(valid==1)\r\n\r\nptr=find(m\u003e0);\r\nvalid2=isequal(m(ptr),mout(ptr));\r\nassert(valid2==1)\r\n\r\n\r\n%%\r\n% Timed Test on a Hard Sudoku\r\n% Non-Valid answer creates a Max score but not a fail\r\n% Hard Sudoku\r\nmstr=['005700009'; '030090010'; '100005300'; '600004700'; '040010050'; '002500001'; '004600002'; '080020040'; '200008600']; \r\n% convert string to array\r\nm=zeros(9);\r\nfor i=1:9\r\n m(i,:)=mstr(i,:)-'0'  ; \r\nend\r\n\r\ntime0=cputime;\r\n mout=sudoku_solver(m)\r\netime=(cputime-time0)*1000 % msec\r\nvalid=all(arrayfun(@(i) all(sum([mout mout']==i)),1:length(mout)));\r\nptr=find(m\u003e0);\r\nvalid2=isequal(m(ptr),mout(ptr));\r\n% Not Asserting for Valid answer\r\nif ~valid,etime=500;end\r\nif ~valid2,etime=500;end\r\nassignin('caller','score',min(500,floor(etime)));","published":true,"deleted":false,"likes_count":8,"comments_count":2,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":51,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2014-01-02T00:31:17.000Z","updated_at":"2025-12-15T20:03:47.000Z","published_at":"2014-01-02T01:30:54.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSolve a Standard 9x9\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/Sudoku\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSudoku\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. Values 1 thru 9 occur in each row, column, and the nine non-overlapping 3x3 matrices starting at the top left corner.\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.free-sudoku.com/sudoku.php?dchoix=evil\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eSudoku practice site\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\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eInput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e m, a 9x9 matrix of values 0 thru 9. Unknowns are 0s.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eOutput:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mout, a 9x9 matrix of values 1 thru 9 that satisfy Sudoku rules.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eScoring:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Time (msec) to solve the Hard Sudoku\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"code\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003e\u003c![CDATA[m         mout\\n390701506 398721546\\n042890701 542896731\\n106540890 176543892\\n820600150 829674153\\n400138009 457138269\\n031002087 631952487\\n065087304 965287314\\n703065920 713465928\\n204309075 284319675]]\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:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eSudoku Variations:\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\u003eFuture challenges will involve the Sudoku variations Diagonal, Arrow(Sums), Inequality, Irregular, and others as they present themselves.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eAlgorithm Spoiler:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e Sudoku's can be readily solved using minimal choice recursion with consistency check. A key step is an index map of all indices that have mutual value exclusion (row,col,3x3), idxmap[81,27]. Another key step is to have an Evolve function that implements all single option values determined by the idxmap. A critical performance enhancement is a Sudoku Consistency Checker that checks for illegal replications of values. Illegal placements by Evolve occur when an incorrect value is asserted into the matrix during recursion trials. The recursive solver finds an idx with minimum options based on idxmap. The values for the idx location are asserted, Evolved, Consistency Checked, and then recursion call if Consistent. When all is Consistent and no unknowns remain the Sudoku is solved. Solution times are in the milli-seconds even for Evil, minimum 17 value, Sudokus.\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":42842,"title":"The sliding puzzle: 15","description":"If you are unfamiliar with the sliding puzzle, enter the command fifteen in your MATLAB command window (or search online, of course). In this problem you are tasked with solving the puzzle.\r\nGiven a scrambled classic 4-by-4 sliding puzzle, return a set of moves that solves it.\r\nThe puzzle is represented by a size [4 4] array, p, with integers from 1 to 15 representing the different tiles, and 0 representing the open slot. A single move is represented by an integer that is the linear index of the the tile you wish to slide into an adjacent open slot. A solution is represented by a row vector, m, of moves, the application of which results in a correctly arranged puzzle.\r\nThe solution does not have to be efficient. It must simply result in a correctly solved puzzle. Illegal moves, such as trying to slide a tile that is not adjacent to the open slot, will be ignored.\r\nExample: (the leading zeros are added only for easier visualization)\r\n p = [ 01 02 03 04;\r\n\r\n       05 10 06 07;\r\n\r\n       09 00 11 08;\r\n\r\n       13 14 15 12]\r\n\r\n m = [6 10 14 15 16]","description_html":"\u003cdiv style = \"text-align: start; line-height: 20.44px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, monospace; font-style: normal; font-size: 14px; font-weight: 400; text-decoration: none solid rgb(0, 0, 0); white-space: normal; \"\u003e\u003cdiv style=\"block-size: 439.938px; display: block; min-width: 0px; padding-block-start: 0px; padding-top: 0px; perspective-origin: 407px 219.969px; transform-origin: 407px 219.969px; 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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eIf you are unfamiliar with the sliding puzzle, enter the command\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e \u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"font-style: italic; \"\u003efifteen\u003c/span\u003e\u003c/span\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003e in your MATLAB command window (or search online, of course). In this problem you are tasked with solving the puzzle.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eGiven a scrambled classic 4-by-4 sliding puzzle, return a set of moves that solves it.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 84px; 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 42px; text-align: left; transform-origin: 384px 42px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe puzzle is represented by a size [4 4] array, p, with integers from 1 to 15 representing the different tiles, and 0 representing the open slot. A single move is represented by an integer that is the linear index of the the tile you wish to slide into an adjacent open slot. A solution is represented by a row vector, m, of moves, the application of which results in a correctly arranged puzzle.\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: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eThe solution does not have to be efficient. It must simply result in a correctly solved puzzle. Illegal moves, such as trying to slide a tile that is not adjacent to the open slot, will be ignored.\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"block-size: 21px; font-family: Helvetica, Arial, sans-serif; line-height: 21px; margin-block-end: 9px; margin-block-start: 2px; margin-bottom: 9px; margin-inline-end: 10px; margin-inline-start: 4px; margin-left: 4px; margin-right: 10px; margin-top: 2px; perspective-origin: 384px 10.5px; text-align: left; transform-origin: 384px 10.5px; white-space: pre-wrap; margin-left: 4px; margin-top: 2px; margin-bottom: 9px; margin-right: 10px; \"\u003e\u003cspan style=\"block-size: auto; display: inline; margin-block-end: 0px; margin-block-start: 0px; margin-bottom: 0px; margin-inline-end: 0px; margin-inline-start: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; perspective-origin: 0px 0px; transform-origin: 0px 0px; \"\u003e\u003cspan style=\"\"\u003eExample: (the leading zeros are added only for easier visualization)\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgb(247, 247, 247); block-size: 183.938px; 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 91.9688px; transform-origin: 404px 91.9688px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e p = [ 01 02 03 04;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       05 10 06 07;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       09 00 11 08;\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e       13 14 15 12]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003cdiv style=\"background-color: rgba(0, 0, 0, 0); block-size: 20.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; 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.4375px; 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.2188px; transform-origin: 404px 10.2188px; 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 0px; tab-size: 4; transform-origin: 0px 0px; white-space: pre; margin-right: 45px; \"\u003e\u003cspan style=\"margin-inline-end: 0px; margin-right: 0px; \"\u003e m = [6 10 14 15 16]\u003c/span\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e\u003c/div\u003e","function_template":"function m = sliding(p)\r\n  m = -1;\r\nend","test_suite":"%%\r\nfiletext = fileread('sliding.m');\r\nassert(isempty(strfind(filetext,'6 10 14 15 16')))\r\nassert(isempty(strfind(filetext,'6,10,14,15,16')))\r\nassert(isempty(strfind(filetext,'eval')))\r\nassert(isempty(strfind(filetext,'assign')))\r\nassert(isempty(strfind(filetext,'echo')))\r\nassert(isempty(strfind(filetext,'freepass')))\r\n\r\n%%\r\np = [1 2 3 4;5 10 6 7;9 0 11 8;13 14 15 12];\r\nm = sliding(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero = find(p == 0);\r\n    [rzero czero] = ind2sub(size(p),zero);\r\n    [rmove cmove] = ind2sub(size(p),m(i));\r\n    if abs(rzero + czero - rmove - cmove) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 0]))\r\n\r\n%%\r\np = [6 3 0 11;7 14 8 5;15 1 2 4;13 9 10 12];\r\nm = sliding(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero = find(p == 0);\r\n    [rzero czero] = ind2sub(size(p),zero);\r\n    [rmove cmove] = ind2sub(size(p),m(i));\r\n    if abs(rzero + czero - rmove - cmove) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 0]))\r\n\r\n%%\r\np = [8 2 3 13;1 6 10 9;15 14 0 5;11 12 4 7];\r\nm = sliding(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero = find(p == 0);\r\n    [rzero czero] = ind2sub(size(p),zero);\r\n    [rmove cmove] = ind2sub(size(p),m(i));\r\n    if abs(rzero + czero - rmove - cmove) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 0]))\r\n\r\n%%\r\np = [11 7 15 9;3 1 0 8;5 12 13 4;14 2 10 6];\r\nm = sliding(p);\r\nfor i = 1:numel(m)\r\n  if round(m(i)) == m(i) \u0026\u0026 m(i) \u003c= numel(p) \u0026\u0026 m(i) \u003e 0\r\n    zero = find(p == 0);\r\n    [rzero czero] = ind2sub(size(p),zero);\r\n    [rmove cmove] = ind2sub(size(p),m(i));\r\n    if abs(rzero + czero - rmove - cmove) == 1\r\n      p([m(i) zero]) = p([zero m(i)]);\r\n    end\r\n  end\r\nend\r\nassert(isequal(p,[1 2 3 4;5 6 7 8;9 10 11 12;13 14 15 0]))","published":true,"deleted":false,"likes_count":6,"comments_count":3,"created_by":15521,"edited_by":15521,"edited_at":"2022-11-18T05:36:02.000Z","deleted_by":null,"deleted_at":null,"solvers_count":28,"test_suite_updated_at":"2022-11-18T05:36:02.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2016-04-30T15:10:14.000Z","updated_at":"2026-02-03T10:27:32.000Z","published_at":"2016-04-30T15:10:14.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\u003eIf you are unfamiliar with the sliding puzzle, enter the command\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:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003efifteen\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e in your MATLAB command window (or search online, of course). In this problem you are tasked with solving the puzzle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven a scrambled classic 4-by-4 sliding puzzle, return a set of moves that solves it.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe puzzle is represented by a size [4 4] array, p, with integers from 1 to 15 representing the different tiles, and 0 representing the open slot. A single move is represented by an integer that is the linear index of the the tile you wish to slide into an adjacent open slot. A solution is represented by a row vector, m, of moves, the application of which results in a correctly arranged puzzle.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe solution does not have to be efficient. It must simply result in a correctly solved puzzle. Illegal moves, such as trying to slide a tile that is not adjacent to the open slot, will be ignored.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003cw:jc w:val=\\\"left\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eExample: (the leading zeros are added only for easier visualization)\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[ p = [ 01 02 03 04;\\n\\n       05 10 06 07;\\n\\n       09 00 11 08;\\n\\n       13 14 15 12]\\n\\n m = [6 10 14 15 16]]]\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\"}]}"}],"no_progress_badge":{"id":53,"name":"Unknown","symbol":"unknown","description":"Partially completed groups","description_html":null,"image_location":"/images/responsive/supporting/matlabcentral/cody/badges/problem_groups_unknown_2.png","bonus":null,"players_count":0,"active":false,"created_by":null,"updated_by":null,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"created_at":"2018-01-10T23:20:29.000Z","updated_at":"2018-01-10T23:20:29.000Z","community_badge_id":null,"award_multiples":false}}