{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2025-12-14T01:33:56.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2025-12-14T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":1700,"title":"Solve the picross! (Easy)","description":"Solve the picross!\r\n\r\n\u003chttp://en.wikipedia.org/wiki/Nonogram\u003e\r\n\r\nThe arguments (horz and vert) are cells containing the clues, e.g:\r\n\r\nhorz = { 2, [1, 1], [] };\r\nvert = { 2, 1, 1 };\r\n\r\nmeans\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\u003e\u003e\r\n\r\nYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\u003e\u003e\r\n\r\nSo, the output argument should be:\r\n\r\npicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\r\n\r\nHave fun!\r\n\r\nSee also:\r\n\u003chttp://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\u003e","description_html":"\u003cp\u003eSolve the picross!\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Nonogram\"\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/p\u003e\u003cp\u003ehorz = { 2, [1, 1], [] };\r\nvert = { 2, 1, 1 };\u003c/p\u003e\u003cp\u003emeans\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\"\u003e\u003cp\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\"\u003e\u003cp\u003eSo, the output argument should be:\u003c/p\u003e\u003cp\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e\u003cp\u003eSee also: \u003ca href = \"http://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\"\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\u003c/a\u003e\u003c/p\u003e","function_template":"function picross = solvePicross( horz, vert )\r\n  picross = zeros( length( horz ), length( vert ) );\r\nend","test_suite":"%% MEET MATT....\r\n% By Tom O'Connell (sensei69)\r\n% http://webpbn.com/index.cgi?id=12795\r\n\r\nhorz = { ...\r\n    [], [1, 1], 5, 7, [1, 3, 1, 1], ...\r\n    [2, 7], [1, 2, 2, 1], [1, 3, 2, 2], [1, 5, 4], [12, 1], ...\r\n    [12, 1], 14, 14, [2, 6], [3, 3] };\r\nvert = { ...\r\n    5, [2, 4], 7, 8, [6, 1], ...\r\n    6, 6, [4, 5], [6, 5], [5, 7], ...\r\n    [2, 2, 7], [5, 7], [3, 1, 2, 3, 1], [5, 2], 4 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% PEACE\r\n% By shay yatim (shay3979)\r\n% http://webpbn.com/index.cgi?id=4496\r\n\r\nhorz = { ...\r\n    6, [2, 2, 2], [2, 2, 2], [1, 2, 1], [1, 4, 1], ...\r\n    [1, 6, 1], [3, 2, 3], [1, 2, 2], [2, 2, 2], 6 };\r\nvert = { ...\r\n    6, [2, 1, 1], [2, 2, 2], [1, 2, 1], 10, ...\r\n    10, [1, 2, 1], [2, 2, 2], [2, 3], 6 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% MATLAB LOGO\r\n\r\nhorz = { ...\r\n    1, 3, [1, 2], 5, [1, 4], ...\r\n    [2, 4], [3, 4], [4, 6], [1, 6], [3, 6], ...\r\n    [7, 8], [8, 8], [5, 9], [4, 10], [6, 2], ...\r\n    [6, 2], 6, 4, 3, 2 };\r\nvert = { 1, 2, 3, 4, 5, ...\r\n    5, 7, [2, 2, 2], [2, 6], [3, 8], ...\r\n    [2, 9], [2, 11], [1, 14], 15, 13, ...\r\n    11, 7, 5, 3, 1 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% THE INVASION HAS BEGUN\r\n\r\nhorz = { ...\r\n    [], [1, 1], [1, 1], 7, [2, 3, 2], ...\r\n    11, [1, 7, 1], [1 1 1 1], [2 2], [] };\r\nvert = { ...\r\n    [], [], 3, 2, [1 5], ...\r\n    [2, 2, 1], [4, 1], 4, [4, 1], [2, 2, 1], ...\r\n    [1, 5], 2, 3, [], [] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% YUMMY\r\n\r\nhorz = { ...\r\n    [], 8, 14, 16, 20, ...\r\n    22, 24, 25, 22, 21, ...\r\n    19, 17, 16, 14, 15, ...\r\n    16, 18, 20, 22, 22, ...\r\n    24, 25, 26, 24, 22, ...\r\n    20, 18, 14, 8, [] };\r\nvert = { ...\r\n    [], 7, 12, 16, 18, ...\r\n    20, 22, 23, 24, 26, ...\r\n    26, 26, 28, 28, 28, ...\r\n    [12, 15], [12, 14], [11, 13], [11, 13], [10, 12], ...\r\n    [9, 11], [8, 10], [8, 10], [6, 8], [5, 7], ...\r\n    [4, 6], [3, 4], [2, 3], 1, [] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% GOTTA CATCH 'EM ALL\r\n\r\nhorz = { ...\r\n    [4, 14, 4], [3, 10], [2, 6, 2, 3], [1, 1, 5, 6, 3, 1], [4, 3, 6, 2, 2], ...\r\n    [1, 3, 6, 2, 3], [2, 1, 2, 2, 2, 5, 1, 1], [2, 1, 2, 2, 3, 8, 2, 1], [2, 7, 5, 5, 2], [3, 4, 4, 1, 6, 1], ...\r\n    [4, 4, 1, 2, 2], [2, 2, 4, 6, 3], [1, 2, 2, 2, 1, 2, 2, 4, 1, 3], [2, 2, 2, 3, 1, 2, 4], [3, 4, 11, 5] };\r\nvert = { ...\r\n    [4, 10], [3, 1, 6, 2], [2, 1, 2, 1, 1], [1, 2, 3, 1, 2], [1, 2, 1], ...\r\n    [4, 1], [4, 1, 1], [2, 1], [2, 2, 1], [2, 2, 1], ...\r\n    [1, 1], [2, 1, 2], [4, 5, 1], 15, 15, ...\r\n    [6, 4, 2], [4, 2, 1, 1], [3, 7, 1, 1], [2, 3, 2, 1, 2], [2, 7, 2, 1], ...\r\n    [2, 10, 1], [1, 11, 1], [1, 6, 1, 2, 1], [1, 1, 2, 1, 1, 1], [1, 1, 1], ...\r\n    [4, 1, 1], [1, 3, 1, 2], [1, 2, 1, 1, 4], [1, 1, 2, 1, 5], [1, 12] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":756,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-08T17:39:27.000Z","updated_at":"2025-12-23T14:52:49.000Z","published_at":"2013-07-08T17:43:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSolve the picross!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Nonogram\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ehorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003emeans\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, the output argument should be:\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\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave fun!\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\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"},{"id":1701,"title":"Solve the picross! (Hard)","description":"Solve the picross!\r\n\r\nhttp://en.wikipedia.org/wiki/Nonogram\r\n\r\nThe arguments (horz and vert) are cells containing the clues, e.g:\r\n\r\nhorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\r\n\r\nmeans\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\u003e\u003e\r\n\r\nYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\u003e\u003e\r\n\r\nSo, the output argument should be:\r\n\r\npicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\r\n\r\nYou have to do some guessings and optimize your code to pass the test suite.\r\n\r\nHave fun!\r\n\r\nSee also:\r\n\u003chttp://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\u003e\r\n","description_html":"\u003cp\u003eSolve the picross!\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Nonogram\"\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/p\u003e\u003cp\u003ehorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\u003c/p\u003e\u003cp\u003emeans\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\"\u003e\u003cp\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\"\u003e\u003cp\u003eSo, the output argument should be:\u003c/p\u003e\u003cp\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/p\u003e\u003cp\u003eYou have to do some guessings and optimize your code to pass the test suite.\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e\u003cp\u003eSee also: \u003ca href = \"http://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\"\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\u003c/a\u003e\u003c/p\u003e","function_template":"function picross = solvePicross( horz, vert )\r\n  picross = zeros( length( horz ), length( vert ) );\r\nend","test_suite":"%% BECKHAM\r\n% From Wikipedia\r\n% http://en.wikipedia.org/wiki/File:Paint_by_numbers_Animation.gif\r\n\r\nhorz = { ...\r\n    3, 5, [3 1], [2 1], [3 3 4], ...\r\n    [2 2 7], [6 1 1], [4 2 2], [1 1], [3 1], ...\r\n    6, [2 7], [6 3 1], [1 2 2 1 1], [4 1 1 3], ...\r\n    [4 2 2], [3 3 1], [3 3], 3, [2 1] };\r\n\r\nvert = { ...\r\n    2, [1 2], [2 3], [2 3], [3 1 1], ...\r\n    [2 1 1], [1 1 1 2 2], [1 1 3 1 3], [2 6 4], [3 3 9 1], ...\r\n    [5 3 2], [3 1 2 2], [2 1 7], [3 3 2], [2 4], ...\r\n    [2 1 2], [2 2 1], [2 2], 1, 1 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% GOT MILK?\r\n% By John Breckenridge (jbrecken)\r\n% http://webpbn.com/index.cgi?id=8169\r\n\r\nhorz = { ...\r\n    [5, 10, 6], [5, 8, 6], [5, 1, 6, 6], [5, 2, 4, 1, 6], [5, 3, 2, 3, 6], ...\r\n    [4, 4, 6], [2, 6], [1, 3, 5], [2, 1, 3, 5], [5, 2, 1, 4], ...\r\n    [1, 1, 2, 5, 4], [2, 1, 2, 5], [2, 3, 6], [3, 1, 1, 7], [4, 2, 8], ...\r\n    [5, 3, 4], [18, 2], [5, 1, 4, 1], [3, 3, 4, 1], [2, 1, 3, 1, 3], ...\r\n    [2, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1], [2, 2, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 3, 1] };\r\n\r\nvert = { ...\r\n    [8, 15], [7, 12], [6, 6, 2], [6, 2, 4], [5, 2, 3, 2], ...\r\n    [4, 1, 4], [3, 1, 2, 1, 3], [1, 2, 3, 1], [2, 1, 1, 1, 2], [3, 2, 5], ...\r\n    [4, 1, 1, 1, 2], [5, 1, 1], [5, 2, 1, 1], [4, 2, 1, 3], [3, 1, 4, 1, 4], ...\r\n    [2, 2, 1, 2, 2, 2], [1, 2, 3, 3], [3, 4, 2], [3, 2, 2], [7, 3, 2, 3], ...\r\n    [9, 4, 2, 2], [16, 3, 1], [16, 3], 17, [19, 1] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% WHERE THERE'S SMOKE\r\n% By Marcus (aanet)\r\n% http://webpbn.com/index.cgi?id=2413\r\n\r\nhorz = { ...\r\n    [1, 3, 2, 1], [1, 2, 2], [3, 4], [2, 3, 2], [2, 1, 6], ...\r\n    [2, 13, 1], [1, 1, 8], [2, 1, 1, 7], [1, 2, 2, 2, 3], [3, 1, 1, 1, 3], ...\r\n    [1, 2, 1, 1, 3], [2, 1, 1, 3], [1, 5, 5], [1, 1, 3], [4, 2], ...\r\n    [2, 2, 1, 2, 1], [2, 1, 2, 3, 2], [4, 1, 6, 1], [3, 4, 3, 2], [4, 2] };\r\n\r\nvert = { ...\r\n    [2, 2, 1], [1, 6, 4, 4], [3, 3, 1, 1, 4], [2, 2], [1, 3, 3, 3], ...\r\n    [1, 1, 1, 2, 1, 2], [2, 1, 1, 1, 1], [2, 4, 3, 3], [3, 1, 2, 3, 1], [1, 4, 2, 1], ...\r\n    [3, 1, 2], [2, 1, 1], [3, 3], [7, 4], [5, 4], ...\r\n    [3, 2, 1, 3], [3, 4, 1], [9, 2], [8, 3], [1, 8, 2] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% IMMORTAL STAR\r\n\r\nhorz = { ...\r\n    75, [55, 17], [13, 31, 12], [11, 27, 10], [9, 25, 8], ...\r\n    [7, 23, 7], [6, 21, 6], [5, 20, 4], [4, 18, 3], [3, 18, 2], ...\r\n    [2, 18, 2], [1, 18, 1], [1, 18, 1], [18, 1], 18, ...\r\n    [3, 3, 1], [2, 1], [2, 4, 1], [8, 8, 1], [1, 10, 10, 2], ...\r\n    [1, 11, 12, 2], [2, 13, 13, 3], [3, 29, 4], [4, 29, 6], [5, 29, 1, 7], ...\r\n    [7, 1, 30, 18], [18, 11, 7, 11, 18], [17, 10, 5, 10, 17], [17, 9, 4, 9, 16], [16, 9, 3, 9, 16], ...\r\n    [16, 8, 3, 8, 16], [16, 8, 3, 8, 15], [16, 8, 3, 8, 15], [15, 8, 3, 8, 15], [15, 7, 3, 7, 3, 15], ...\r\n    [15, 5, 8, 3, 14, 15], [15, 15, 4, 15, 15], [15, 38, 3, 15], [15, 2, 14, 14, 3, 15], [15, 3, 13, 12, 4, 15], ...\r\n    [16, 16, 12, 4, 15], [16, 4, 11, 11, 4, 15], [16, 5, 10, 10, 5, 16], [16, 4, 10, 10, 5, 16], [17, 5, 13, 12, 5, 16], ...\r\n    [18, 5, 23, 5, 17], [18, 5, 21, 5, 17], [19, 5, 17, 5, 18], [20, 5, 12, 5, 19], [20, 5, 4, 5, 20], ...\r\n    [21, 5, 4, 21], [22, 5, 4, 22], [23, 5, 3, 23], [24, 3, 3, 24], [26, 3, 2, 26], ...\r\n    [28, 2, 2, 27], [29, 3, 3, 29], [31, 10, 30], [32, 6, 31], [35, 33] };\r\n\r\nvert = { ...\r\n    [13, 41], [11, 39], [10, 38], [9, 37], [8, 36], ...\r\n    [7, 35], [6, 35], [5, 34], [5, 34], [4, 34], ...\r\n    [4, 34], [3, 34], [3, 34], [2, 34], [2, 34], ...\r\n    [2, 7, 20], [2, 3, 16], [2, 2, 7, 15], [2, 10, 13], [2, 3, 8, 12], ...\r\n    [2, 3, 8, 10], [3, 6, 8, 9], [3, 5, 7, 7, 8], [4, 12, 7, 7, 7], [5, 23, 6, 6], ...\r\n    [6, 25, 5, 6], [7, 27, 4, 5], [8, 1, 29, 3, 5], [17, 29, 3, 4], [16, 30, 1, 3], ...\r\n    [16, 31, 2, 3], [15, 11, 14, 2, 2], [15, 9, 12, 1, 1], [15, 8, 3, 6, 2, 1], [15, 9, 2, 5, 1, 1], ...\r\n    [15, 10, 1, 6, 2], [15, 17, 6, 2], [15, 16, 6, 2], [15, 18, 5, 2], [15, 9, 2, 5, 2], ...\r\n    [15, 9, 1, 5, 2], [15, 8, 2, 6, 1], [15, 10, 12, 2, 1], [15, 11, 12, 1, 1], [16, 31, 2, 2], ...\r\n    [16, 31, 2, 3], [8, 1, 29, 2, 4], [6, 29, 2, 4], [5, 27, 3, 5], [4, 25, 4, 6], ...\r\n    [3, 24, 4, 6], [3, 12, 8, 6, 7], [2, 4, 7, 7, 8], [2, 7, 8, 9], [2, 5, 8, 10], ...\r\n    [1, 3, 9, 11], [1, 1, 11, 12], [1, 2, 9, 13], [2, 3, 4, 15], [2, 6, 18], ...\r\n    [2, 35], [2, 35], [2, 35], [3, 35], [3, 35], ...\r\n    [4, 35], [4, 35], [5, 35], [6, 36], [7, 37], ...\r\n    [7, 37], [8, 38], [9, 39], [11, 41], [14, 45] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":14,"created_by":756,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-08T17:51:45.000Z","updated_at":"2026-01-08T13:16:02.000Z","published_at":"2013-07-08T17:53:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSolve the picross!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Nonogram\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ehorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003emeans\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, the output argument should be:\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\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to do some guessings and optimize your code to pass the test suite.\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\u003eHave fun!\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\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":1700,"title":"Solve the picross! (Easy)","description":"Solve the picross!\r\n\r\n\u003chttp://en.wikipedia.org/wiki/Nonogram\u003e\r\n\r\nThe arguments (horz and vert) are cells containing the clues, e.g:\r\n\r\nhorz = { 2, [1, 1], [] };\r\nvert = { 2, 1, 1 };\r\n\r\nmeans\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\u003e\u003e\r\n\r\nYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\u003e\u003e\r\n\r\nSo, the output argument should be:\r\n\r\npicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\r\n\r\nHave fun!\r\n\r\nSee also:\r\n\u003chttp://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\u003e","description_html":"\u003cp\u003eSolve the picross!\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Nonogram\"\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/p\u003e\u003cp\u003ehorz = { 2, [1, 1], [] };\r\nvert = { 2, 1, 1 };\u003c/p\u003e\u003cp\u003emeans\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\"\u003e\u003cp\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\"\u003e\u003cp\u003eSo, the output argument should be:\u003c/p\u003e\u003cp\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e\u003cp\u003eSee also: \u003ca href = \"http://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\"\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\u003c/a\u003e\u003c/p\u003e","function_template":"function picross = solvePicross( horz, vert )\r\n  picross = zeros( length( horz ), length( vert ) );\r\nend","test_suite":"%% MEET MATT....\r\n% By Tom O'Connell (sensei69)\r\n% http://webpbn.com/index.cgi?id=12795\r\n\r\nhorz = { ...\r\n    [], [1, 1], 5, 7, [1, 3, 1, 1], ...\r\n    [2, 7], [1, 2, 2, 1], [1, 3, 2, 2], [1, 5, 4], [12, 1], ...\r\n    [12, 1], 14, 14, [2, 6], [3, 3] };\r\nvert = { ...\r\n    5, [2, 4], 7, 8, [6, 1], ...\r\n    6, 6, [4, 5], [6, 5], [5, 7], ...\r\n    [2, 2, 7], [5, 7], [3, 1, 2, 3, 1], [5, 2], 4 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% PEACE\r\n% By shay yatim (shay3979)\r\n% http://webpbn.com/index.cgi?id=4496\r\n\r\nhorz = { ...\r\n    6, [2, 2, 2], [2, 2, 2], [1, 2, 1], [1, 4, 1], ...\r\n    [1, 6, 1], [3, 2, 3], [1, 2, 2], [2, 2, 2], 6 };\r\nvert = { ...\r\n    6, [2, 1, 1], [2, 2, 2], [1, 2, 1], 10, ...\r\n    10, [1, 2, 1], [2, 2, 2], [2, 3], 6 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% MATLAB LOGO\r\n\r\nhorz = { ...\r\n    1, 3, [1, 2], 5, [1, 4], ...\r\n    [2, 4], [3, 4], [4, 6], [1, 6], [3, 6], ...\r\n    [7, 8], [8, 8], [5, 9], [4, 10], [6, 2], ...\r\n    [6, 2], 6, 4, 3, 2 };\r\nvert = { 1, 2, 3, 4, 5, ...\r\n    5, 7, [2, 2, 2], [2, 6], [3, 8], ...\r\n    [2, 9], [2, 11], [1, 14], 15, 13, ...\r\n    11, 7, 5, 3, 1 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% THE INVASION HAS BEGUN\r\n\r\nhorz = { ...\r\n    [], [1, 1], [1, 1], 7, [2, 3, 2], ...\r\n    11, [1, 7, 1], [1 1 1 1], [2 2], [] };\r\nvert = { ...\r\n    [], [], 3, 2, [1 5], ...\r\n    [2, 2, 1], [4, 1], 4, [4, 1], [2, 2, 1], ...\r\n    [1, 5], 2, 3, [], [] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% YUMMY\r\n\r\nhorz = { ...\r\n    [], 8, 14, 16, 20, ...\r\n    22, 24, 25, 22, 21, ...\r\n    19, 17, 16, 14, 15, ...\r\n    16, 18, 20, 22, 22, ...\r\n    24, 25, 26, 24, 22, ...\r\n    20, 18, 14, 8, [] };\r\nvert = { ...\r\n    [], 7, 12, 16, 18, ...\r\n    20, 22, 23, 24, 26, ...\r\n    26, 26, 28, 28, 28, ...\r\n    [12, 15], [12, 14], [11, 13], [11, 13], [10, 12], ...\r\n    [9, 11], [8, 10], [8, 10], [6, 8], [5, 7], ...\r\n    [4, 6], [3, 4], [2, 3], 1, [] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% GOTTA CATCH 'EM ALL\r\n\r\nhorz = { ...\r\n    [4, 14, 4], [3, 10], [2, 6, 2, 3], [1, 1, 5, 6, 3, 1], [4, 3, 6, 2, 2], ...\r\n    [1, 3, 6, 2, 3], [2, 1, 2, 2, 2, 5, 1, 1], [2, 1, 2, 2, 3, 8, 2, 1], [2, 7, 5, 5, 2], [3, 4, 4, 1, 6, 1], ...\r\n    [4, 4, 1, 2, 2], [2, 2, 4, 6, 3], [1, 2, 2, 2, 1, 2, 2, 4, 1, 3], [2, 2, 2, 3, 1, 2, 4], [3, 4, 11, 5] };\r\nvert = { ...\r\n    [4, 10], [3, 1, 6, 2], [2, 1, 2, 1, 1], [1, 2, 3, 1, 2], [1, 2, 1], ...\r\n    [4, 1], [4, 1, 1], [2, 1], [2, 2, 1], [2, 2, 1], ...\r\n    [1, 1], [2, 1, 2], [4, 5, 1], 15, 15, ...\r\n    [6, 4, 2], [4, 2, 1, 1], [3, 7, 1, 1], [2, 3, 2, 1, 2], [2, 7, 2, 1], ...\r\n    [2, 10, 1], [1, 11, 1], [1, 6, 1, 2, 1], [1, 1, 2, 1, 1, 1], [1, 1, 1], ...\r\n    [4, 1, 1], [1, 3, 1, 2], [1, 2, 1, 1, 4], [1, 1, 2, 1, 5], [1, 12] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":4,"created_by":756,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":11,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-08T17:39:27.000Z","updated_at":"2025-12-23T14:52:49.000Z","published_at":"2013-07-08T17:43:22.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSolve the picross!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Nonogram\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ehorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003emeans\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, the output argument should be:\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\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eHave fun!\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\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1701-solve-the-picross-hard\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"},{"id":1701,"title":"Solve the picross! (Hard)","description":"Solve the picross!\r\n\r\nhttp://en.wikipedia.org/wiki/Nonogram\r\n\r\nThe arguments (horz and vert) are cells containing the clues, e.g:\r\n\r\nhorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\r\n\r\nmeans\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\u003e\u003e\r\n\r\nYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\r\n\r\n\u003c\u003chttp://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\u003e\u003e\r\n\r\nSo, the output argument should be:\r\n\r\npicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\r\n\r\nYou have to do some guessings and optimize your code to pass the test suite.\r\n\r\nHave fun!\r\n\r\nSee also:\r\n\u003chttp://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\u003e\r\n","description_html":"\u003cp\u003eSolve the picross!\u003c/p\u003e\u003cp\u003e\u003ca href = \"http://en.wikipedia.org/wiki/Nonogram\"\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/a\u003e\u003c/p\u003e\u003cp\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/p\u003e\u003cp\u003ehorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\u003c/p\u003e\u003cp\u003emeans\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_268468DemoEmptyPicross.png\"\u003e\u003cp\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/p\u003e\u003cimg src = \"http://img15.hostingpics.net/thumbs/mini_676179DemoCompletedPicross.png\"\u003e\u003cp\u003eSo, the output argument should be:\u003c/p\u003e\u003cp\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/p\u003e\u003cp\u003eYou have to do some guessings and optimize your code to pass the test suite.\u003c/p\u003e\u003cp\u003eHave fun!\u003c/p\u003e\u003cp\u003eSee also: \u003ca href = \"http://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\"\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\u003c/a\u003e\u003c/p\u003e","function_template":"function picross = solvePicross( horz, vert )\r\n  picross = zeros( length( horz ), length( vert ) );\r\nend","test_suite":"%% BECKHAM\r\n% From Wikipedia\r\n% http://en.wikipedia.org/wiki/File:Paint_by_numbers_Animation.gif\r\n\r\nhorz = { ...\r\n    3, 5, [3 1], [2 1], [3 3 4], ...\r\n    [2 2 7], [6 1 1], [4 2 2], [1 1], [3 1], ...\r\n    6, [2 7], [6 3 1], [1 2 2 1 1], [4 1 1 3], ...\r\n    [4 2 2], [3 3 1], [3 3], 3, [2 1] };\r\n\r\nvert = { ...\r\n    2, [1 2], [2 3], [2 3], [3 1 1], ...\r\n    [2 1 1], [1 1 1 2 2], [1 1 3 1 3], [2 6 4], [3 3 9 1], ...\r\n    [5 3 2], [3 1 2 2], [2 1 7], [3 3 2], [2 4], ...\r\n    [2 1 2], [2 2 1], [2 2], 1, 1 };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% GOT MILK?\r\n% By John Breckenridge (jbrecken)\r\n% http://webpbn.com/index.cgi?id=8169\r\n\r\nhorz = { ...\r\n    [5, 10, 6], [5, 8, 6], [5, 1, 6, 6], [5, 2, 4, 1, 6], [5, 3, 2, 3, 6], ...\r\n    [4, 4, 6], [2, 6], [1, 3, 5], [2, 1, 3, 5], [5, 2, 1, 4], ...\r\n    [1, 1, 2, 5, 4], [2, 1, 2, 5], [2, 3, 6], [3, 1, 1, 7], [4, 2, 8], ...\r\n    [5, 3, 4], [18, 2], [5, 1, 4, 1], [3, 3, 4, 1], [2, 1, 3, 1, 3], ...\r\n    [2, 1, 1, 1, 1, 2], [2, 1, 1, 1, 1], [2, 2, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1, 1, 3, 1] };\r\n\r\nvert = { ...\r\n    [8, 15], [7, 12], [6, 6, 2], [6, 2, 4], [5, 2, 3, 2], ...\r\n    [4, 1, 4], [3, 1, 2, 1, 3], [1, 2, 3, 1], [2, 1, 1, 1, 2], [3, 2, 5], ...\r\n    [4, 1, 1, 1, 2], [5, 1, 1], [5, 2, 1, 1], [4, 2, 1, 3], [3, 1, 4, 1, 4], ...\r\n    [2, 2, 1, 2, 2, 2], [1, 2, 3, 3], [3, 4, 2], [3, 2, 2], [7, 3, 2, 3], ...\r\n    [9, 4, 2, 2], [16, 3, 1], [16, 3], 17, [19, 1] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% WHERE THERE'S SMOKE\r\n% By Marcus (aanet)\r\n% http://webpbn.com/index.cgi?id=2413\r\n\r\nhorz = { ...\r\n    [1, 3, 2, 1], [1, 2, 2], [3, 4], [2, 3, 2], [2, 1, 6], ...\r\n    [2, 13, 1], [1, 1, 8], [2, 1, 1, 7], [1, 2, 2, 2, 3], [3, 1, 1, 1, 3], ...\r\n    [1, 2, 1, 1, 3], [2, 1, 1, 3], [1, 5, 5], [1, 1, 3], [4, 2], ...\r\n    [2, 2, 1, 2, 1], [2, 1, 2, 3, 2], [4, 1, 6, 1], [3, 4, 3, 2], [4, 2] };\r\n\r\nvert = { ...\r\n    [2, 2, 1], [1, 6, 4, 4], [3, 3, 1, 1, 4], [2, 2], [1, 3, 3, 3], ...\r\n    [1, 1, 1, 2, 1, 2], [2, 1, 1, 1, 1], [2, 4, 3, 3], [3, 1, 2, 3, 1], [1, 4, 2, 1], ...\r\n    [3, 1, 2], [2, 1, 1], [3, 3], [7, 4], [5, 4], ...\r\n    [3, 2, 1, 3], [3, 4, 1], [9, 2], [8, 3], [1, 8, 2] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n\r\n%% IMMORTAL STAR\r\n\r\nhorz = { ...\r\n    75, [55, 17], [13, 31, 12], [11, 27, 10], [9, 25, 8], ...\r\n    [7, 23, 7], [6, 21, 6], [5, 20, 4], [4, 18, 3], [3, 18, 2], ...\r\n    [2, 18, 2], [1, 18, 1], [1, 18, 1], [18, 1], 18, ...\r\n    [3, 3, 1], [2, 1], [2, 4, 1], [8, 8, 1], [1, 10, 10, 2], ...\r\n    [1, 11, 12, 2], [2, 13, 13, 3], [3, 29, 4], [4, 29, 6], [5, 29, 1, 7], ...\r\n    [7, 1, 30, 18], [18, 11, 7, 11, 18], [17, 10, 5, 10, 17], [17, 9, 4, 9, 16], [16, 9, 3, 9, 16], ...\r\n    [16, 8, 3, 8, 16], [16, 8, 3, 8, 15], [16, 8, 3, 8, 15], [15, 8, 3, 8, 15], [15, 7, 3, 7, 3, 15], ...\r\n    [15, 5, 8, 3, 14, 15], [15, 15, 4, 15, 15], [15, 38, 3, 15], [15, 2, 14, 14, 3, 15], [15, 3, 13, 12, 4, 15], ...\r\n    [16, 16, 12, 4, 15], [16, 4, 11, 11, 4, 15], [16, 5, 10, 10, 5, 16], [16, 4, 10, 10, 5, 16], [17, 5, 13, 12, 5, 16], ...\r\n    [18, 5, 23, 5, 17], [18, 5, 21, 5, 17], [19, 5, 17, 5, 18], [20, 5, 12, 5, 19], [20, 5, 4, 5, 20], ...\r\n    [21, 5, 4, 21], [22, 5, 4, 22], [23, 5, 3, 23], [24, 3, 3, 24], [26, 3, 2, 26], ...\r\n    [28, 2, 2, 27], [29, 3, 3, 29], [31, 10, 30], [32, 6, 31], [35, 33] };\r\n\r\nvert = { ...\r\n    [13, 41], [11, 39], [10, 38], [9, 37], [8, 36], ...\r\n    [7, 35], [6, 35], [5, 34], [5, 34], [4, 34], ...\r\n    [4, 34], [3, 34], [3, 34], [2, 34], [2, 34], ...\r\n    [2, 7, 20], [2, 3, 16], [2, 2, 7, 15], [2, 10, 13], [2, 3, 8, 12], ...\r\n    [2, 3, 8, 10], [3, 6, 8, 9], [3, 5, 7, 7, 8], [4, 12, 7, 7, 7], [5, 23, 6, 6], ...\r\n    [6, 25, 5, 6], [7, 27, 4, 5], [8, 1, 29, 3, 5], [17, 29, 3, 4], [16, 30, 1, 3], ...\r\n    [16, 31, 2, 3], [15, 11, 14, 2, 2], [15, 9, 12, 1, 1], [15, 8, 3, 6, 2, 1], [15, 9, 2, 5, 1, 1], ...\r\n    [15, 10, 1, 6, 2], [15, 17, 6, 2], [15, 16, 6, 2], [15, 18, 5, 2], [15, 9, 2, 5, 2], ...\r\n    [15, 9, 1, 5, 2], [15, 8, 2, 6, 1], [15, 10, 12, 2, 1], [15, 11, 12, 1, 1], [16, 31, 2, 2], ...\r\n    [16, 31, 2, 3], [8, 1, 29, 2, 4], [6, 29, 2, 4], [5, 27, 3, 5], [4, 25, 4, 6], ...\r\n    [3, 24, 4, 6], [3, 12, 8, 6, 7], [2, 4, 7, 7, 8], [2, 7, 8, 9], [2, 5, 8, 10], ...\r\n    [1, 3, 9, 11], [1, 1, 11, 12], [1, 2, 9, 13], [2, 3, 4, 15], [2, 6, 18], ...\r\n    [2, 35], [2, 35], [2, 35], [3, 35], [3, 35], ...\r\n    [4, 35], [4, 35], [5, 35], [6, 36], [7, 37], ...\r\n    [7, 37], [8, 38], [9, 39], [11, 41], [14, 45] };\r\n\r\ngetseq = @(soluce) arrayfun( @(i)cellfun( 'length', regexp( char(soluce(i,:)+'0'), '1+', 'match' ) ), 1:size(soluce,1), 'Uniformoutput', false );\r\nequalseq = @(actual,expected) length(actual) == length(expected) \u0026\u0026 all( cellfun( @(a,e)length(a) == length(e) \u0026\u0026 all( a == e ), actual, expected ) );\r\nchecksoluce = @( soluce, horz, vert ) size(soluce,1) == length(horz) \u0026\u0026 size(soluce,2) == length(vert) \u0026\u0026 equalseq( getseq( soluce ), horz ) \u0026\u0026 equalseq( getseq( soluce' ), vert );\r\nassert( checksoluce( solvePicross( horz, vert ), horz, vert ) )\r\n","published":true,"deleted":false,"likes_count":1,"comments_count":14,"created_by":756,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-07-08T17:51:45.000Z","updated_at":"2026-01-08T13:16:02.000Z","published_at":"2013-07-08T17:53:25.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/image\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/media/image1.png\"}],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSolve the picross!\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Nonogram\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://en.wikipedia.org/wiki/Nonogram\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eThe arguments (horz and vert) are cells containing the clues, e.g:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003ehorz = { 2, [1, 1], [] }; vert = { 2, 1, 1 };\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003emeans\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to return the completed picross, a logical or double matrix with a 0 for a white case and a 1 for a black case. If we solve the previous example:\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:customXml w:element=\\\"image\\\"\u003e\u003cw:customXmlPr\u003e\u003cw:attr w:name=\\\"height\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"width\\\" w:val=\\\"-1\\\"/\u003e\u003cw:attr w:name=\\\"relationshipId\\\" w:val=\\\"rId1\\\"/\u003e\u003c/w:customXmlPr\u003e\u003c/w:customXml\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eSo, the output argument should be:\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\u003epicross = [ 1 1 0 ; 1 0 1 ; 0 0 0 ];\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou have to do some guessings and optimize your code to pass the test suite.\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\u003eHave fun!\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\u003eSee also:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\\\"\u003e\u003cw:r\u003e\u003cw:t\u003ehttp://www.mathworks.fr/matlabcentral/cody/problems/1700-solve-the-picross-easy\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"},{\"partUri\":\"/media/image1.png\",\"contentType\":\"image/png\",\"content\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAADAFBMVEV4eHiTk5P29vaBgYGcnJzAwMC3t7eKiorS0tLt7e3b29vk5OTJycn///9vb28AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD61b95AAAAyklEQVR42q2SSQ6FIAxAWzQxkcj976lEE5R+hojQOmw+Cxa8RwcoGnhf6oNDD0AvGL8j/E2wC+JiXwSaAKbbatGkLjBrX13szynmtPXnKc2eCRiMGQtXxrq2hmZRuuXx6SVdPlPpopeC387sFMMIwdsyAMFAEcHuptW5oIaKYgjHBBoZ512snMeJ8g7o0DmA5jwKXRdqy9W6gfMzhd7iMOySlxq0qn/z4leR43HNQ8WrLtYi1Dz+pnjsmt/8ZsulwLgQOOeC4EyQHH5z1GUZiLNTtwAAAABJRU5ErkJggg==\"}]}"}],"term":"tag:\"algorithmics\"","current_player_id":null,"fields":[{"name":"page","type":"integer","callback":null,"default":1,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"per_page","type":"integer","callback":null,"default":50,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"sort","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":null,"prepend":true},{"name":"body","type":"text","callback":null,"default":"*:*","directive":null,"facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":false},{"name":"group","type":"string","callback":null,"default":null,"directive":"group","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"difficulty_rating_bin","type":"string","callback":null,"default":null,"directive":"difficulty_rating_bin","facet":true,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"id","type":"integer","callback":null,"default":null,"directive":"id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"tag","type":"string","callback":null,"default":null,"directive":"tag","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"product","type":"string","callback":null,"default":null,"directive":"product","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_at","type":"timeframe","callback":{},"default":null,"directive":"created_at","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"profile_id","type":"integer","callback":null,"default":null,"directive":"author_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"created_by","type":"string","callback":null,"default":null,"directive":"author","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player_id","type":"integer","callback":null,"default":null,"directive":"solver_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"player","type":"string","callback":null,"default":null,"directive":"solver","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"solvers_count","type":"integer","callback":null,"default":null,"directive":"solvers_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"comments_count","type":"integer","callback":null,"default":null,"directive":"comments_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"likes_count","type":"integer","callback":null,"default":null,"directive":"likes_count","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leader_id","type":"integer","callback":null,"default":null,"directive":"leader_id","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true},{"name":"leading_solution","type":"integer","callback":null,"default":null,"directive":"leading_solution","facet":null,"facet_method":"and","operator":null,"param":"term","static":null,"prepend":true}],"filters":[{"name":"asset_type","type":"string","callback":null,"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":null,"static":"\"cody:problem\"","prepend":true},{"name":"profile_id","type":"integer","callback":{},"default":null,"directive":null,"facet":null,"facet_method":"and","operator":null,"param":"author_id","static":null,"prepend":true}],"query":{"params":{"per_page":50,"term":"tag:\"algorithmics\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"algorithmics\"","","\"","algorithmics","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f53482e1ec0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f53482e1e20\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f53482e1560\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f53482e2140\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f53482e20a0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f53482e2000\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f53482e1f60\u003e":"tag:\"algorithmics\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f53482e1f60\u003e":"tag:\"algorithmics\""},"queried_facets":{}},"query_backend":{"connection":{"configuration":{"index_url":"http://index-op-v2/solr/","query_url":"http://search-op-v2/solr/","direct_access_index_urls":["http://index-op-v2/solr/"],"direct_access_query_urls":["http://search-op-v2/solr/"],"timeout":10,"vhost":"search","exchange":"search.topic","heartbeat":30,"pre_index_mode":false,"host":"rabbitmq-eks","port":5672,"username":"search","password":"J3bGPZzQ7asjJcCk","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"algorithmics\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"algorithmics\"","","\"","algorithmics","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f53482e1ec0\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f53482e1e20\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f53482e1560\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f53482e2140\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f53482e20a0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f53482e2000\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f53482e1f60\u003e":"tag:\"algorithmics\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f53482e1f60\u003e":"tag:\"algorithmics\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":1700,"difficulty_rating":"hard"},{"id":1701,"difficulty_rating":"hard"}]}}