{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-04-06T14:01:22.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-04-06T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":44082,"title":"Recycled Numbers (CodeJam Qualification Round 2012)","description":"Let's say a pair of distinct positive integers ( _n_ , _m_ ) is recycled if you can obtain _m_ by moving some digits \r\nfrom the back of _n_ to the front without changing their order. For example, (12345, 34512) is a recycled pair since you can obtain 34512 by moving 345 from the end of 12345 to the front. Note that _n_ and _m_ must have the same number of digits in order to be a recycled pair. Neither _n_ nor _m_ can have leading zeros.\r\n\r\nGiven integers *A* and *B* with the same number of digits and no leading zeros, how many *distinct* recycled pairs ( _n_ , _m_ ) are there with *A* ≤ _n_ \u003c _m_ ≤ *B* ? \r\n\r\nBe careful, it is more tricky than you might first think...","description_html":"\u003cp\u003eLet's say a pair of distinct positive integers ( \u003ci\u003en\u003c/i\u003e , \u003ci\u003em\u003c/i\u003e ) is recycled if you can obtain \u003ci\u003em\u003c/i\u003e by moving some digits \r\nfrom the back of \u003ci\u003en\u003c/i\u003e to the front without changing their order. For example, (12345, 34512) is a recycled pair since you can obtain 34512 by moving 345 from the end of 12345 to the front. Note that \u003ci\u003en\u003c/i\u003e and \u003ci\u003em\u003c/i\u003e must have the same number of digits in order to be a recycled pair. Neither \u003ci\u003en\u003c/i\u003e nor \u003ci\u003em\u003c/i\u003e can have leading zeros.\u003c/p\u003e\u003cp\u003eGiven integers \u003cb\u003eA\u003c/b\u003e and \u003cb\u003eB\u003c/b\u003e with the same number of digits and no leading zeros, how many \u003cb\u003edistinct\u003c/b\u003e recycled pairs ( \u003ci\u003en\u003c/i\u003e , \u003ci\u003em\u003c/i\u003e ) are there with \u003cb\u003eA\u003c/b\u003e ≤ \u003ci\u003en\u003c/i\u003e \u0026lt; \u003ci\u003em\u003c/i\u003e ≤ \u003cb\u003eB\u003c/b\u003e ?\u003c/p\u003e\u003cp\u003eBe careful, it is more tricky than you might first think...\u003c/p\u003e","function_template":"function y = recycled_numbers(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\na=1;\r\nb=9;\r\ny_correct = 0;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=10;\r\nb=40;\r\ny_correct = 3;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=1111;\r\nb=2222;\r\ny_correct = 287 ; %:)\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=21;\r\nb=31;\r\ny_correct = 0;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=1;\r\nb=9;\r\ny_correct = 0;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=104;\r\nb=989;\r\nassert(isequal(recycled_numbers(a,b),781))\r\n%%\r\na=10;\r\nb=99;\r\ny = 36;\r\nassert(isequal(recycled_numbers(a,b),y))\r\n%%\r\nassert(isequal(recycled_numbers(100,999),801))\r\n%%\r\na=1000;\r\nb=9999;\r\ny_correct = 12060;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\nb=484;\r\na=954;\r\nassert(isequal(recycled_numbers(b,a),203))\r\n%%\r\na=159887;\r\nb=195662;\r\ncorrect = 2058;\r\nassert(isequal(recycled_numbers(a,b),correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2017-03-09T12:41:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-03-09T11:10:22.000Z","updated_at":"2025-12-05T12:51:14.000Z","published_at":"2017-03-09T11:21: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\u003eLet's say a pair of distinct positive integers (\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\u003en\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: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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ) is recycled if you can obtain\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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e by moving some digits from the back of\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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to the front without changing their order. For example, (12345, 34512) is a recycled pair since you can obtain 34512 by moving 345 from the end of 12345 to the front. Note that\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw: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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e must have the same number of digits in order to be a recycled pair. Neither\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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e nor\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e can have leading zeros.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven integers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the same number of digits and no leading zeros, how many\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edistinct\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e recycled pairs (\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\u003en\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: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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ) are there with\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ≤\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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt;\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\u003em\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:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBe careful, it is more tricky than you might first think...\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":1870,"title":"GJam:2013 World B: MAD Drummer","description":"This Challenge is derived from the \u003chttp://code.google.com/codejam/ Google Code Jam 2013 World Championship\u003e. The \u003chttp://code.google.com/codejam/contest/2437491/dashboard#s=p1 Problem B Drummer\u003e is modified for Cody. The Google question story is to find the Drummer with the Best Beat based on the Minimum Absolute Delta metric. The MAD (aka LAD) is more complicated than LMSF.\r\n\r\nThe challenge is to produce a series that has a  Minimum Absolute Delta from a series of increasing values. The user series is of the form b,b+K,b+2*k,b+3*k,...,b+(N-1)*k for a set of N values.\r\n\r\n*Input:* v ;  A vector of two to ten integers of increasing values\r\n\r\n*Output:* MAD ; the Minimum Absolute Delta of the optimum sequence from given values. \r\n\r\n*Accuracy:* \u003c2e-6\r\n\r\n*Examples:*\r\n\r\n  [10 70] {0}\r\n  [0 10 19 30] {0.5}\r\n  [2 5 10 15 20 24]{0.75}\r\n\r\nThe \u003chttp://code.google.com/codejam/contest/2437491/dashboard#s=a\u0026a=1 Drummer Analysis\u003e may be of help. The \u003chttp://code.google.com/codejam/contest/2437491/scoreboard?c=2437491# Champions solutions\u003e can be seen at the Contest Scoreboard if a user profile is created. Java and C appear to dominate. Code Jam entries can be entered at \u003chttp://code.google.com/codejam/contest/2437491/dashboard#s=p1 Drummer Solve B-small\u003e.\r\n\r\n*Best Time: 24 minutes*\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is derived from the \u003ca href = \"http://code.google.com/codejam/\"\u003eGoogle Code Jam 2013 World Championship\u003c/a\u003e. The \u003ca href = \"http://code.google.com/codejam/contest/2437491/dashboard#s=p1\"\u003eProblem B Drummer\u003c/a\u003e is modified for Cody. The Google question story is to find the Drummer with the Best Beat based on the Minimum Absolute Delta metric. The MAD (aka LAD) is more complicated than LMSF.\u003c/p\u003e\u003cp\u003eThe challenge is to produce a series that has a  Minimum Absolute Delta from a series of increasing values. The user series is of the form b,b+K,b+2*k,b+3*k,...,b+(N-1)*k for a set of N values.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e v ;  A vector of two to ten integers of increasing values\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e MAD ; the Minimum Absolute Delta of the optimum sequence from given values.\u003c/p\u003e\u003cp\u003e\u003cb\u003eAccuracy:\u003c/b\u003e \u0026lt;2e-6\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[10 70] {0}\r\n[0 10 19 30] {0.5}\r\n[2 5 10 15 20 24]{0.75}\r\n\u003c/pre\u003e\u003cp\u003eThe \u003ca href = \"http://code.google.com/codejam/contest/2437491/dashboard#s=a\u0026a=1\"\u003eDrummer Analysis\u003c/a\u003e may be of help. The \u003ca href = \"http://code.google.com/codejam/contest/2437491/scoreboard?c=2437491#\"\u003eChampions solutions\u003c/a\u003e can be seen at the Contest Scoreboard if a user profile is created. Java and C appear to dominate. Code Jam entries can be entered at \u003ca href = \"http://code.google.com/codejam/contest/2437491/dashboard#s=p1\"\u003eDrummer Solve B-small\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBest Time: 24 minutes\u003c/b\u003e\u003c/p\u003e","function_template":"function MAD=Drummer(v)\r\n MAD=0;\r\nend","test_suite":"%%\r\ntic\r\nv=[10 70 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 10 19 30 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[2 5 10 15 20 24 ];\r\nexp=0.7500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[60 62 63 65 67 68 ];\r\nexp=0.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 4 9 16 17 24 29 32 33 ];\r\nexp=2.1428571;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 8 10 18 29 36 43 46 62 ];\r\nexp=5.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[2 5 7 10 12 15 17 23 24 27 ];\r\nexp=1.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 8 12 14 19 28 30 31 32 ];\r\nexp=3.4375000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 4 9 16 25 36 49 64 81 ];\r\nexp=10.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 8 12 22 28 38 59 77 80 ];\r\nexp=10.0625000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[31 37 41 47 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 87 95 96 98 99 100 ];\r\nexp=33.9166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[8 13 15 20 26 ];\r\nexp=1.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 50 51 52 53 54 55 56 57 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[94 95 96 97 98 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 50 56 63 73 ];\r\nexp=2.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[3 9 11 14 16 24 29 32 34 39 ];\r\nexp=2.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[64 66 68 69 ];\r\nexp=0.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[2 6 9 14 21 73 84 87 90 99 ];\r\nexp=18.9000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[48 49 50 52 53 55 56 57 59 ];\r\nexp=0.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[22 23 24 27 30 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[16 17 22 27 29 30 35 36 39 42 ];\r\nexp=1.8750000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[22 23 24 25 26 27 28 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[16 18 21 22 24 27 29 31 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 100 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[62 63 64 65 66 67 68 69 70 71 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[12 17 21 22 26 31 ];\r\nexp=1.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[86 87 88 89 90 91 92 93 94 95 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[3 11 19 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[59 60 63 66 68 70 ];\r\nexp=0.6666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[78 81 83 ];\r\nexp=0.2500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 51 53 54 56 57 59 ];\r\nexp=0.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[5 10 14 19 21 26 27 30 32 33 ];\r\nexp=2.7222222;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 2 3 15 18 23 47 49 74 75 ];\r\nexp=11.6250000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[33 36 46 54 56 58 ];\r\nexp=3.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 6 11 13 23 28 31 32 33 ];\r\nexp=3.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[62 68 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 50 51 52 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[60 62 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[60 63 67 70 72 73 76 ];\r\nexp=1.1000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[90 91 92 93 94 95 96 97 98 99 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[37 41 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 2 3 5 9 13 14 20 21 27 ];\r\nexp=2.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 86 87 92 98 99 100 ];\r\nexp=33.4166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[80 84 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[3 5 8 12 67 81 88 90 95 97 ];\r\nexp=20.4166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 70 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 49 100 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[87 88 89 90 91 92 93 94 95 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[6 8 14 15 18 24 29 33 37 40 ];\r\nexp=1.8333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 2 5 6 9 11 12 14 15 16 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[39 42 46 54 61 66 74 ];\r\nexp=2.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 4 96 97 98 99 100 ];\r\nexp=36.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[73 74 75 76 77 78 79 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 6 13 14 23 24 27 30 33 ];\r\nexp=3.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[57 58 59 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[81 82 83 84 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[89 91 92 94 ];\r\nexp=0.2500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 5 13 15 17 23 28 29 33 ];\r\nexp=2.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[33 34 35 36 37 38 39 40 41 42 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[72 73 74 75 76 77 78 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[75 76 77 78 79 80 81 82 83 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 4 8 12 16 20 24 28 32 36 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 5 6 12 16 18 20 25 26 ];\r\nexp=1.8000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[24 30 36 42 43 45 49 54 56 60 ];\r\nexp=3.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[39 40 45 47 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 6 7 11 18 19 20 24 29 35 ];\r\nexp=2.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[52 53 55 56 57 58 59 60 62 63 ];\r\nexp=0.4166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[24 35 42 47 ];\r\nexp=1.6666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[65 67 68 69 70 71 73 75 76 ];\r\nexp=0.6666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 3 9 16 26 44 49 61 81 ];\r\nexp=10.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[6 9 12 13 15 16 17 ];\r\nexp=1.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 5 13 22 25 31 34 44 49 ];\r\nexp=3.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[7 13 24 25 46 57 62 66 88 89 ];\r\nexp=6.1875000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[92 94 96 98 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 5 6 8 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[84 85 86 87 88 89 90 91 92 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 5 6 9 58 77 87 96 98 100 ];\r\nexp=18.8333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[7 13 15 20 21 26 29 35 39 44 ];\r\nexp=1.8125000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 51 100 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[18 22 23 ];\r\nexp=0.7500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[35 36 37 38 39 40 41 42 43 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 2 4 5 60 87 93 97 99 100 ];\r\nexp=25.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 10 20 30 40 50 60 70 80 90 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[72 73 75 77 78 79 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[87 88 89 90 91 92 93 94 95 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[12 13 14 16 18 20 24 26 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[59 64 66 68 70 ];\r\nexp=1.1250000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[46 57 67 ];\r\nexp=0.2500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 9 13 16 17 22 27 38 43 45 ];\r\nexp=3.2857143;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[35 38 40 45 48 51 56 61 66 ];\r\nexp=1.6875000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 6 9 12 88 91 94 97 100 ];\r\nexp=29.2000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 4 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[63 68 70 73 77 ];\r\nexp=0.8333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[18 26 36 39 42 43 ];\r\nexp=4.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[8 9 14 19 23 25 32 36 37 ];\r\nexp=1.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[11 15 17 22 ];\r\nexp=0.7500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[43 45 47 50 54 58 60 61 65 66 ];\r\nexp=1.4285714;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[18 19 20 21 22 23 24 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[39 44 47 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\ntoc","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-09-11T03:38:37.000Z","updated_at":"2013-09-11T04:51:14.000Z","published_at":"2013-09-11T04:51: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:t\u003eThis Challenge is derived from 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://code.google.com/codejam/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGoogle Code Jam 2013 World Championship\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. 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://code.google.com/codejam/contest/2437491/dashboard#s=p1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem B Drummer\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is modified for Cody. The Google question story is to find the Drummer with the Best Beat based on the Minimum Absolute Delta metric. The MAD (aka LAD) is more complicated than LMSF.\u003c/w:t\u003e\u003c/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 challenge is to produce a series that has a Minimum Absolute Delta from a series of increasing values. The user series is of the form b,b+K,b+2*k,b+3*k,...,b+(N-1)*k for a set of N values.\u003c/w:t\u003e\u003c/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 v ; A vector of two to ten integers of increasing values\u003c/w:t\u003e\u003c/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 MAD ; the Minimum Absolute Delta of the optimum sequence from given values.\u003c/w:t\u003e\u003c/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\u003eAccuracy:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt;2e-6\u003c/w:t\u003e\u003c/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[[10 70] {0}\\n[0 10 19 30] {0.5}\\n[2 5 10 15 20 24]{0.75}]]\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\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/2437491/dashboard#s=a\u0026amp;a=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDrummer Analysis\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e may be of help. 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://code.google.com/codejam/contest/2437491/scoreboard?c=2437491#\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eChampions solutions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can be seen at the Contest Scoreboard if a user profile is created. Java and C appear to dominate. Code Jam entries can be entered at\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/2437491/dashboard#s=p1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDrummer Solve B-small\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\u003eBest Time: 24 minutes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"errors":[],"problems":[{"id":44082,"title":"Recycled Numbers (CodeJam Qualification Round 2012)","description":"Let's say a pair of distinct positive integers ( _n_ , _m_ ) is recycled if you can obtain _m_ by moving some digits \r\nfrom the back of _n_ to the front without changing their order. For example, (12345, 34512) is a recycled pair since you can obtain 34512 by moving 345 from the end of 12345 to the front. Note that _n_ and _m_ must have the same number of digits in order to be a recycled pair. Neither _n_ nor _m_ can have leading zeros.\r\n\r\nGiven integers *A* and *B* with the same number of digits and no leading zeros, how many *distinct* recycled pairs ( _n_ , _m_ ) are there with *A* ≤ _n_ \u003c _m_ ≤ *B* ? \r\n\r\nBe careful, it is more tricky than you might first think...","description_html":"\u003cp\u003eLet's say a pair of distinct positive integers ( \u003ci\u003en\u003c/i\u003e , \u003ci\u003em\u003c/i\u003e ) is recycled if you can obtain \u003ci\u003em\u003c/i\u003e by moving some digits \r\nfrom the back of \u003ci\u003en\u003c/i\u003e to the front without changing their order. For example, (12345, 34512) is a recycled pair since you can obtain 34512 by moving 345 from the end of 12345 to the front. Note that \u003ci\u003en\u003c/i\u003e and \u003ci\u003em\u003c/i\u003e must have the same number of digits in order to be a recycled pair. Neither \u003ci\u003en\u003c/i\u003e nor \u003ci\u003em\u003c/i\u003e can have leading zeros.\u003c/p\u003e\u003cp\u003eGiven integers \u003cb\u003eA\u003c/b\u003e and \u003cb\u003eB\u003c/b\u003e with the same number of digits and no leading zeros, how many \u003cb\u003edistinct\u003c/b\u003e recycled pairs ( \u003ci\u003en\u003c/i\u003e , \u003ci\u003em\u003c/i\u003e ) are there with \u003cb\u003eA\u003c/b\u003e ≤ \u003ci\u003en\u003c/i\u003e \u0026lt; \u003ci\u003em\u003c/i\u003e ≤ \u003cb\u003eB\u003c/b\u003e ?\u003c/p\u003e\u003cp\u003eBe careful, it is more tricky than you might first think...\u003c/p\u003e","function_template":"function y = recycled_numbers(a,b)\r\n  y = x;\r\nend","test_suite":"%%\r\na=1;\r\nb=9;\r\ny_correct = 0;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=10;\r\nb=40;\r\ny_correct = 3;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=1111;\r\nb=2222;\r\ny_correct = 287 ; %:)\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=21;\r\nb=31;\r\ny_correct = 0;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=1;\r\nb=9;\r\ny_correct = 0;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\na=104;\r\nb=989;\r\nassert(isequal(recycled_numbers(a,b),781))\r\n%%\r\na=10;\r\nb=99;\r\ny = 36;\r\nassert(isequal(recycled_numbers(a,b),y))\r\n%%\r\nassert(isequal(recycled_numbers(100,999),801))\r\n%%\r\na=1000;\r\nb=9999;\r\ny_correct = 12060;\r\nassert(isequal(recycled_numbers(a,b),y_correct))\r\n%%\r\nb=484;\r\na=954;\r\nassert(isequal(recycled_numbers(b,a),203))\r\n%%\r\na=159887;\r\nb=195662;\r\ncorrect = 2058;\r\nassert(isequal(recycled_numbers(a,b),correct))\r\n","published":true,"deleted":false,"likes_count":3,"comments_count":2,"created_by":5390,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":23,"test_suite_updated_at":"2017-03-09T12:41:35.000Z","rescore_all_solutions":false,"group_id":1,"created_at":"2017-03-09T11:10:22.000Z","updated_at":"2025-12-05T12:51:14.000Z","published_at":"2017-03-09T11:21: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\u003eLet's say a pair of distinct positive integers (\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\u003en\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: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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ) is recycled if you can obtain\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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e by moving some digits from the back of\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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e to the front without changing their order. For example, (12345, 34512) is a recycled pair since you can obtain 34512 by moving 345 from the end of 12345 to the front. Note that\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw: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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e must have the same number of digits in order to be a recycled pair. Neither\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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e nor\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e can have leading zeros.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eGiven integers\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e with the same number of digits and no leading zeros, how many\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003edistinct\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e recycled pairs (\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\u003en\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: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\u003em\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ) are there with\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eA\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ≤\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\u003en\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt;\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\u003em\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:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eB\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e ?\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eBe careful, it is more tricky than you might first think...\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":1870,"title":"GJam:2013 World B: MAD Drummer","description":"This Challenge is derived from the \u003chttp://code.google.com/codejam/ Google Code Jam 2013 World Championship\u003e. The \u003chttp://code.google.com/codejam/contest/2437491/dashboard#s=p1 Problem B Drummer\u003e is modified for Cody. The Google question story is to find the Drummer with the Best Beat based on the Minimum Absolute Delta metric. The MAD (aka LAD) is more complicated than LMSF.\r\n\r\nThe challenge is to produce a series that has a  Minimum Absolute Delta from a series of increasing values. The user series is of the form b,b+K,b+2*k,b+3*k,...,b+(N-1)*k for a set of N values.\r\n\r\n*Input:* v ;  A vector of two to ten integers of increasing values\r\n\r\n*Output:* MAD ; the Minimum Absolute Delta of the optimum sequence from given values. \r\n\r\n*Accuracy:* \u003c2e-6\r\n\r\n*Examples:*\r\n\r\n  [10 70] {0}\r\n  [0 10 19 30] {0.5}\r\n  [2 5 10 15 20 24]{0.75}\r\n\r\nThe \u003chttp://code.google.com/codejam/contest/2437491/dashboard#s=a\u0026a=1 Drummer Analysis\u003e may be of help. The \u003chttp://code.google.com/codejam/contest/2437491/scoreboard?c=2437491# Champions solutions\u003e can be seen at the Contest Scoreboard if a user profile is created. Java and C appear to dominate. Code Jam entries can be entered at \u003chttp://code.google.com/codejam/contest/2437491/dashboard#s=p1 Drummer Solve B-small\u003e.\r\n\r\n*Best Time: 24 minutes*\r\n\r\n","description_html":"\u003cp\u003eThis Challenge is derived from the \u003ca href = \"http://code.google.com/codejam/\"\u003eGoogle Code Jam 2013 World Championship\u003c/a\u003e. The \u003ca href = \"http://code.google.com/codejam/contest/2437491/dashboard#s=p1\"\u003eProblem B Drummer\u003c/a\u003e is modified for Cody. The Google question story is to find the Drummer with the Best Beat based on the Minimum Absolute Delta metric. The MAD (aka LAD) is more complicated than LMSF.\u003c/p\u003e\u003cp\u003eThe challenge is to produce a series that has a  Minimum Absolute Delta from a series of increasing values. The user series is of the form b,b+K,b+2*k,b+3*k,...,b+(N-1)*k for a set of N values.\u003c/p\u003e\u003cp\u003e\u003cb\u003eInput:\u003c/b\u003e v ;  A vector of two to ten integers of increasing values\u003c/p\u003e\u003cp\u003e\u003cb\u003eOutput:\u003c/b\u003e MAD ; the Minimum Absolute Delta of the optimum sequence from given values.\u003c/p\u003e\u003cp\u003e\u003cb\u003eAccuracy:\u003c/b\u003e \u0026lt;2e-6\u003c/p\u003e\u003cp\u003e\u003cb\u003eExamples:\u003c/b\u003e\u003c/p\u003e\u003cpre class=\"language-matlab\"\u003e[10 70] {0}\r\n[0 10 19 30] {0.5}\r\n[2 5 10 15 20 24]{0.75}\r\n\u003c/pre\u003e\u003cp\u003eThe \u003ca href = \"http://code.google.com/codejam/contest/2437491/dashboard#s=a\u0026a=1\"\u003eDrummer Analysis\u003c/a\u003e may be of help. The \u003ca href = \"http://code.google.com/codejam/contest/2437491/scoreboard?c=2437491#\"\u003eChampions solutions\u003c/a\u003e can be seen at the Contest Scoreboard if a user profile is created. Java and C appear to dominate. Code Jam entries can be entered at \u003ca href = \"http://code.google.com/codejam/contest/2437491/dashboard#s=p1\"\u003eDrummer Solve B-small\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eBest Time: 24 minutes\u003c/b\u003e\u003c/p\u003e","function_template":"function MAD=Drummer(v)\r\n MAD=0;\r\nend","test_suite":"%%\r\ntic\r\nv=[10 70 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 10 19 30 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[2 5 10 15 20 24 ];\r\nexp=0.7500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[60 62 63 65 67 68 ];\r\nexp=0.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 4 9 16 17 24 29 32 33 ];\r\nexp=2.1428571;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 8 10 18 29 36 43 46 62 ];\r\nexp=5.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[2 5 7 10 12 15 17 23 24 27 ];\r\nexp=1.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 8 12 14 19 28 30 31 32 ];\r\nexp=3.4375000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 4 9 16 25 36 49 64 81 ];\r\nexp=10.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 8 12 22 28 38 59 77 80 ];\r\nexp=10.0625000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[31 37 41 47 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 87 95 96 98 99 100 ];\r\nexp=33.9166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[8 13 15 20 26 ];\r\nexp=1.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 50 51 52 53 54 55 56 57 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[94 95 96 97 98 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 50 56 63 73 ];\r\nexp=2.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[3 9 11 14 16 24 29 32 34 39 ];\r\nexp=2.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[64 66 68 69 ];\r\nexp=0.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[2 6 9 14 21 73 84 87 90 99 ];\r\nexp=18.9000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[48 49 50 52 53 55 56 57 59 ];\r\nexp=0.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[22 23 24 27 30 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[16 17 22 27 29 30 35 36 39 42 ];\r\nexp=1.8750000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[22 23 24 25 26 27 28 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[16 18 21 22 24 27 29 31 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 100 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[62 63 64 65 66 67 68 69 70 71 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[12 17 21 22 26 31 ];\r\nexp=1.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[86 87 88 89 90 91 92 93 94 95 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[3 11 19 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[59 60 63 66 68 70 ];\r\nexp=0.6666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[78 81 83 ];\r\nexp=0.2500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 51 53 54 56 57 59 ];\r\nexp=0.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[5 10 14 19 21 26 27 30 32 33 ];\r\nexp=2.7222222;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 2 3 15 18 23 47 49 74 75 ];\r\nexp=11.6250000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[33 36 46 54 56 58 ];\r\nexp=3.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 6 11 13 23 28 31 32 33 ];\r\nexp=3.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[62 68 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 50 51 52 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[60 62 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[60 63 67 70 72 73 76 ];\r\nexp=1.1000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[90 91 92 93 94 95 96 97 98 99 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[37 41 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 2 3 5 9 13 14 20 21 27 ];\r\nexp=2.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 86 87 92 98 99 100 ];\r\nexp=33.4166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[80 84 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[3 5 8 12 67 81 88 90 95 97 ];\r\nexp=20.4166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[49 70 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 49 100 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[87 88 89 90 91 92 93 94 95 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[6 8 14 15 18 24 29 33 37 40 ];\r\nexp=1.8333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 2 5 6 9 11 12 14 15 16 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[39 42 46 54 61 66 74 ];\r\nexp=2.3333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 4 96 97 98 99 100 ];\r\nexp=36.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[73 74 75 76 77 78 79 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 6 13 14 23 24 27 30 33 ];\r\nexp=3.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[57 58 59 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[81 82 83 84 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[89 91 92 94 ];\r\nexp=0.2500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 5 13 15 17 23 28 29 33 ];\r\nexp=2.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[33 34 35 36 37 38 39 40 41 42 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[72 73 74 75 76 77 78 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[75 76 77 78 79 80 81 82 83 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 4 8 12 16 20 24 28 32 36 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 5 6 12 16 18 20 25 26 ];\r\nexp=1.8000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[24 30 36 42 43 45 49 54 56 60 ];\r\nexp=3.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[39 40 45 47 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 6 7 11 18 19 20 24 29 35 ];\r\nexp=2.4000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[52 53 55 56 57 58 59 60 62 63 ];\r\nexp=0.4166667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[24 35 42 47 ];\r\nexp=1.6666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[65 67 68 69 70 71 73 75 76 ];\r\nexp=0.6666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 3 9 16 26 44 49 61 81 ];\r\nexp=10.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[6 9 12 13 15 16 17 ];\r\nexp=1.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 5 13 22 25 31 34 44 49 ];\r\nexp=3.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[7 13 24 25 46 57 62 66 88 89 ];\r\nexp=6.1875000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[92 94 96 98 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 1 2 3 5 6 8 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[84 85 86 87 88 89 90 91 92 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 5 6 9 58 77 87 96 98 100 ];\r\nexp=18.8333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[7 13 15 20 21 26 29 35 39 44 ];\r\nexp=1.8125000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 51 100 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[18 22 23 ];\r\nexp=0.7500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[35 36 37 38 39 40 41 42 43 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[1 2 4 5 60 87 93 97 99 100 ];\r\nexp=25.1666667;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 10 20 30 40 50 60 70 80 90 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[72 73 75 77 78 79 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[87 88 89 90 91 92 93 94 95 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[12 13 14 16 18 20 24 26 ];\r\nexp=1.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[59 64 66 68 70 ];\r\nexp=1.1250000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[46 57 67 ];\r\nexp=0.2500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 9 13 16 17 22 27 38 43 45 ];\r\nexp=3.2857143;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[35 38 40 45 48 51 56 61 66 ];\r\nexp=1.6875000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 6 9 12 88 91 94 97 100 ];\r\nexp=29.2000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[0 3 4 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[63 68 70 73 77 ];\r\nexp=0.8333333;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[18 26 36 39 42 43 ];\r\nexp=4.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[8 9 14 19 23 25 32 36 37 ];\r\nexp=1.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[11 15 17 22 ];\r\nexp=0.7500000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[43 45 47 50 54 58 60 61 65 66 ];\r\nexp=1.4285714;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[18 19 20 21 22 23 24 ];\r\nexp=0.0000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\n%%\r\nv=[39 44 47 ];\r\nexp=0.5000000;\r\nMAD=Drummer(v);\r\nassert(abs(MAD-exp)\u003c2e-6)\r\ntoc","published":true,"deleted":false,"likes_count":1,"comments_count":0,"created_by":3097,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":5,"test_suite_updated_at":null,"rescore_all_solutions":false,"group_id":1,"created_at":"2013-09-11T03:38:37.000Z","updated_at":"2013-09-11T04:51:14.000Z","published_at":"2013-09-11T04:51: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:t\u003eThis Challenge is derived from 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://code.google.com/codejam/\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eGoogle Code Jam 2013 World Championship\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e. 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://code.google.com/codejam/contest/2437491/dashboard#s=p1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eProblem B Drummer\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e is modified for Cody. The Google question story is to find the Drummer with the Best Beat based on the Minimum Absolute Delta metric. The MAD (aka LAD) is more complicated than LMSF.\u003c/w:t\u003e\u003c/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 challenge is to produce a series that has a Minimum Absolute Delta from a series of increasing values. The user series is of the form b,b+K,b+2*k,b+3*k,...,b+(N-1)*k for a set of N values.\u003c/w:t\u003e\u003c/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 v ; A vector of two to ten integers of increasing values\u003c/w:t\u003e\u003c/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 MAD ; the Minimum Absolute Delta of the optimum sequence from given values.\u003c/w:t\u003e\u003c/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\u003eAccuracy:\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u0026lt;2e-6\u003c/w:t\u003e\u003c/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[[10 70] {0}\\n[0 10 19 30] {0.5}\\n[2 5 10 15 20 24]{0.75}]]\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\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/2437491/dashboard#s=a\u0026amp;a=1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDrummer Analysis\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e may be of help. 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://code.google.com/codejam/contest/2437491/scoreboard?c=2437491#\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eChampions solutions\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e can be seen at the Contest Scoreboard if a user profile is created. Java and C appear to dominate. Code Jam entries can be entered at\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/2437491/dashboard#s=p1\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eDrummer Solve B-small\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\u003eBest Time: 24 minutes\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"term":"tag:\"codejam\"","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:\"codejam\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"codejam\"","","\"","codejam","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f69f1472c70\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f69f1472bd0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f69f14721d0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f69f1473990\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f69f14738f0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f69f1473850\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f69f1473670\u003e":"tag:\"codejam\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f69f1473670\u003e":"tag:\"codejam\""},"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":"cody-search","password":"78X075ddcV44","virtual_host":"search","indexer":"amqp","http_logging":"true","core":"cody"},"query_connection":{"uri":"http://search-op-v2/solr/cody/","proxy":null,"connection":{"parallel_manager":null,"headers":{"User-Agent":"Faraday v1.0.1"},"params":{},"options":{"params_encoder":"Faraday::FlatParamsEncoder","proxy":null,"bind":null,"timeout":null,"open_timeout":null,"read_timeout":null,"write_timeout":null,"boundary":null,"oauth":null,"context":null,"on_data":null},"ssl":{"verify":true,"ca_file":null,"ca_path":null,"verify_mode":null,"cert_store":null,"client_cert":null,"client_key":null,"certificate":null,"private_key":null,"verify_depth":null,"version":null,"min_version":null,"max_version":null},"default_parallel_manager":null,"builder":{"adapter":{"name":"Faraday::Adapter::NetHttp","args":[],"block":null},"handlers":[{"name":"Faraday::Response::RaiseError","args":[],"block":null}],"app":{"app":{"ssl_cert_store":{"verify_callback":null,"error":null,"error_string":null,"chain":null,"time":null},"app":{},"connection_options":{},"config_block":null}}},"url_prefix":"http://search-op-v2/solr/cody/","manual_proxy":false,"proxy":null},"update_format":"RSolr::JSON::Generator","update_path":"update","options":{"url":"http://search-op-v2/solr/cody"}}},"query":{"params":{"per_page":50,"term":"tag:\"codejam\"","current_player":null,"sort":"map(difficulty_value,0,0,999) asc"},"parser":"MathWorks::Search::Solr::QueryParser","directives":{"term":{"directives":{"tag":[["tag:\"codejam\"","","\"","codejam","\""]]}}},"facets":{"#\u003cMathWorks::Search::Field:0x00007f69f1472c70\u003e":null,"#\u003cMathWorks::Search::Field:0x00007f69f1472bd0\u003e":null},"filters":{"#\u003cMathWorks::Search::Field:0x00007f69f14721d0\u003e":"\"cody:problem\""},"fields":{"#\u003cMathWorks::Search::Field:0x00007f69f1473990\u003e":1,"#\u003cMathWorks::Search::Field:0x00007f69f14738f0\u003e":50,"#\u003cMathWorks::Search::Field:0x00007f69f1473850\u003e":"map(difficulty_value,0,0,999) asc","#\u003cMathWorks::Search::Field:0x00007f69f1473670\u003e":"tag:\"codejam\""},"user_query":{"#\u003cMathWorks::Search::Field:0x00007f69f1473670\u003e":"tag:\"codejam\""},"queried_facets":{}},"options":{"fields":["id","difficulty_rating"]},"join":" "},"results":[{"id":44082,"difficulty_rating":"medium"},{"id":1870,"difficulty_rating":"unrated"}]}}