{"id":6366,"date":"2020-02-05T13:02:37","date_gmt":"2020-02-05T13:02:37","guid":{"rendered":"https:\/\/www.dyalog.com\/blog\/?p=6366"},"modified":"2020-11-27T09:58:32","modified_gmt":"2020-11-27T09:58:32","slug":"2019-apl-problem-solving-competition-phase-i-problems-sample-solutions","status":"publish","type":"post","link":"https:\/\/www.dyalog.com\/blog\/2020\/02\/2019-apl-problem-solving-competition-phase-i-problems-sample-solutions\/","title":{"rendered":"2019 APL Problem Solving Competition: Phase I Problems Sample Solutions"},"content":{"rendered":"<style>\np {\ntext-align: left;\n}\n#indexOf tr td{\nborder: 0!important;\ntext-align: left;\n}\n.entry-content table{\nborder-bottom:0;\n}\n.entry-content td{\nborder-top:0;\n}\n<\/style>\n<p>The following are my attempts at the Phase I problems of the 2019 <a target=\"_blank\" href=\"https:\/\/www.dyalog.com\/student-competition.htm\">APL Problem Solving Competition<\/a>. There are not necessarily &ldquo;right answers&rdquo; as personal style and taste come into play. More explanation of the code is provided here than common practice. All solutions pass all the tests specified in the <a target=\"_blank\" href=\"http:\/\/www.dyalog.com\/uploads\/files\/student_competition\/2019_problems_phase1.pdf\">official problem description<\/a>.<\/p>\n<p><a name=\"1\"><\/a><\/p>\n<p><strong>1. Chunky Monkey<\/strong><\/p>\n<p>Write a function that, given a scalar or vector as the right argument and a positive (<code class=\"language-apl\">&gt;0<\/code>) integer chunk size<code class=\"language-apl\"> n <\/code>as the left argument, breaks the array&rsquo;s items up into chunks of size<code class=\"language-apl\"> n<\/code>. If the number of elements in the array is not evenly divisible by<code class=\"language-apl\"> n<\/code>, then the last chunk will have fewer than<code class=\"language-apl\"> n <\/code>elements.<\/p>\n<p>&#128161;Hint: The <em>partitioned enclose<\/em> function <code class=\"language-apl\">\u2282<\/code> could be helpful for this problem.<\/p>\n<pre><code class=\"language-apl\">   f1\u2190{((\u2262\u2375)\u2374\u237a\u21911)\u2282\u2375}\r\n<\/code><\/pre>\n<p>Basically, the problem is to construct an appropriate boolean left argument to<code class=\"language-apl\"> \u2282<\/code>. For this the <em>reshape<\/em> function <code class=\"language-apl\">\u237a\u2374\u2375<\/code> is apt, which repeats the items of <code class=\"language-apl\">\u2375<\/code> up to length <code class=\"language-apl\">\u237a<\/code>.<\/p>\n<pre><code class=\"language-apl\">   9 \u2374 1 0 0                     (9 \u2374 1 0 0) \u2282 'ABCDEFGHI'\r\n1 0 0 1 0 0 1 0 0             \u250c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2510\r\n                              \u2502ABC\u2502DEF\u2502GHI\u2502\r\n                              \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2518\r\n\r\n   11 \u2374 1 0 0                    (11 \u2374 1 0 0) \u2282 'ABCDEFGHIJK'\r\n1 0 0 1 0 0 1 0 0 1 0         \u250c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2510\r\n                              \u2502ABC\u2502DEF\u2502GHI\u2502JK\u2502\r\n                              \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2518\r\n<\/code><\/pre>\n<p><a name=\"2\"><\/a><\/p>\n<p><strong>2. Making the Grade<\/strong><\/p>\n<style>\n#gradeTable tr td {\nborder: 1px solid black;\nwhite-space: nowrap;\npadding-left: 0.5em;\n}\n<\/style>\n<table style=\"border-bottom:none;margin:0;\">\n<tr>\n<td>\n<table id=\"gradeTable\" border=1 cellpadding=3 cellspacing=0>\n<tr>\n<td>Score Range<\/td>\n<td>Letter Grade<\/td>\n<\/tr>\n<tr>\n<td align=center>0-64<\/td>\n<td align=center>F<\/td>\n<\/tr>\n<tr>\n<td align=center>65-69<\/td>\n<td align=center>D<\/td>\n<\/tr>\n<tr>\n<td align=center>70-79<\/td>\n<td align=center>C<\/td>\n<\/tr>\n<tr>\n<td align=center>80-89<\/td>\n<td align=center>B<\/td>\n<\/tr>\n<tr>\n<td align=center>90-100<\/td>\n<td align=center>A<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<td>&nbsp;<\/td>\n<td valign=top>\n<p>Write a function that, given an array of integer test scores in the inclusive range 0\u2013100, returns an identically-shaped array of the corresponding letter grades according to the table to the left.<\/p>\n<p>&#128161;Hint: You may want to investigate the <em>interval index<\/em> function<code class=\"language-apl\"> \u2378<\/code>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<pre><code class=\"language-apl\">   f2\u2190 {'FDCBA'[0 65 70 80 90\u2378\u2375]}\r\n<\/code><\/pre>\n<p>For example:<\/p>\n<pre><code class=\"language-apl\">   range\u2190 0 65 70 80 90\r\n   score\u2190 0 65 89 64 75 100\r\n\r\n   range \u2378 score                      range \u2378 2 3\u2374score\r\n1 2 4 1 3 5                        1 2 4\r\n                                   1 3 5\r\n   'FDCBA'[1 2 4 1 3 5]               'FDCBA'[2 3\u23741 2 4 1 3 5]\r\nFDBFCA                             FDB\r\n                                   FCA\r\n    f2 score                          f2 2 3\u2374score\r\nFDBFCA                             FDB\r\n                                   FCA\r\n<\/code><\/pre>\n<p>The examples on the right illustrate that the functions<code class=\"language-apl\"> \u2378 <\/code>and<code class=\"language-apl\"> [] <\/code> extend consistently to array arguments.<\/p>\n<p>In APL, functions take array arguments, and so too <em>indexing<\/em> takes array arguments, including the indices (the &ldquo;subscripts&rdquo;). This property is integral to the template<\/p>\n<p><code class=\"language-apl\">&nbsp;&nbsp; Y<\/code><em> indexing<\/em><code class=\"language-apl\"> (X <\/code><em>index<\/em><code class=\"language-apl\"> \u2375)<\/code><\/p>\n<p style=\"margin:0;\">where<\/p>\n<table id=\"indexOf\">\n<tr>\n<td>&nbsp;<\/td>\n<td>\n<table style=\"margin:0;\">\n<tr>\n<td><code class=\"language-apl\">X &nbsp;<\/code><\/td>\n<td>domain for looking things up<\/td>\n<\/tr>\n<tr>\n<td><code class=\"language-apl\">Y <\/code><\/td>\n<td>range where you want to end up; &ldquo;aliases&rdquo; corresponding to<code class=\"language-apl\"> X <\/code><\/td>\n<\/tr>\n<tr>\n<td><em>index<\/em><\/td>\n<td>a function to do the looking up, such as<code class=\"language-apl\"> \u2373 <\/code>or<code class=\"language-apl\"> \u2378 <\/code><\/td>\n<\/tr>\n<tr>\n<td><em>indexing &nbsp;<\/em><\/td>\n<td>a function to do indexing into<code class=\"language-apl\"> X<\/code>&nbsp;,<code class=\"language-apl\"> <\/code>such as<code class=\"language-apl\"> [] <\/code>or<code class=\"language-apl\"> \u2337 <\/code> or (dyadic)<code class=\"language-apl\"> \u2283 <\/code><\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<p><a name=\"3\"><\/a><\/p>\n<p><strong>3. Grade Distribution<\/strong><\/p>\n<p>Given a non-empty character vector of single-letter grades, produce a 3-column, 5-row, alphabetically-sorted matrix of each grade, the number of occurrences of that grade, and the percentage (rounded to 1 decimal position) of the total number of occurrences of that grade. The table should have a row for each grade even if there are no occurrences of a grade. Note: due to rounding the last column might not total 100%.<\/p>\n<p>&#128161;Hint: The <em>key<\/em> operator <code class=\"language-apl\">\u2338<\/code> could be useful for this problem.<\/p>\n<pre><code class=\"language-apl\">   f3\u2190{a,k,1\u2355\u236a100\u00d7k\u00f7+\u233fk\u2190\u00af1+{\u2262\u2375}\u2338\u2375\u236a\u2368a\u2190'ABCDF'}\r\n<\/code><\/pre>\n<p>The result of<code class=\"language-apl\"> f\u2338 <\/code>is ordered by the unique major cells in the keys. If a particular order is required, or if a particular set of keys is required (even when some keys don&rsquo;t occur in the argument), the computation can be effected by prefacing keys to the argument (here<code class=\"language-apl\"> ,\u2368a\u2190'ABCDF'<\/code>) and then applying an inverse function (here<code class=\"language-apl\"> \u00af1+<\/code>) to the result of <code class=\"language-apl\">\u2338<\/code>.<\/p>\n<p>For the <em>key<\/em> operator<code class=\"language-apl\"> \u2338<\/code>, in particular cases, for example the letter distribution in a corpus of English text, the universe of letters and their ordering are known (A-Z); in principle, it is not possible to &ldquo;know&rdquo; the complete universe of keys, or their ordering.\n<\/p>\n<p>The function<code class=\"language-apl\"> f3x <\/code>illustrates the complications.<code class=\"language-apl\"> f3 <\/code> is the same as above; extra spaces are inserted into both functions to facilitate comparison.<\/p>\n<pre><code class=\"language-apl\">   f3 \u2190 {a,   k,1\u2355\u236a100\u00d7k\u00f7+\u233fk\u2190\u00af1+{\u2262\u2375}\u2338\u2375\u236a\u2368a\u2190'ABCDF'}\r\n   f3x\u2190 {(\u222a\u2375),k,1\u2355\u236a100\u00d7k\u00f7+\u233fk\u2190   {\u2262\u2375}\u2338\u2375           }\r\n\r\n   \u22a2 g1\u2190 9 3 8 4 7\/'DABFC'\r\nDDDDDDDDDAAABBBBBBBBFFFFCCCCCCC\r\n\r\n   f3x g1                            f3 g1\r\nD 9  29.0                         A 3   9.7\r\nA 3   9.7                         B 8  25.8\r\nB 8  25.8                         C 7  22.6\r\nF 4  12.9                         D 9  29.0\r\nC 7  22.6                         F 4  12.9\r\n                  \r\n   \u22a2 g2\u2190 ('F'\u2260grade)\u233fgrade\r\nDDDDDDDDDAAABBBBBBBBCCCCCCC\r\n\r\n   f3x g2                            f3 g2\r\nD 9  33.3                         A 3  11.1\r\nA 3  11.1                         B 8  29.6\r\nB 8  29.6                         C 7  25.9\r\nC 7  25.9                         D 9  33.3\r\n                                  F 0   0.0\r\n\r\n<\/code><\/pre>\n<p><a name=\"4\"><\/a><\/p>\n<p style=\"margin:2em 0 1em 0;\"><strong>4. Knight Moves<\/strong><\/p>\n<table style=\"margin:0;\">\n<tr>\n<td valign=top>\n<pre class=\"language-apl\">\r\n\u250c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2510\r\n\u25021 1\u25021 2\u25021 3\u25021 4\u25021 5\u25021 6\u25021 7\u25021 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25022 1\u25022 2\u25022 3\u25022 4\u25022 5\u25022 6\u25022 7\u25022 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25023 1\u25023 2\u2502<u>3 3<\/u>\u25023 4\u2502<u>3 5<\/u>\u25023 6\u25023 7\u25023 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25024 1\u2502<u>4 2<\/u>\u25024 3\u25024 4\u25024 5\u2502<u>4 6<\/u>\u25024 7\u25024 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25025 1\u25025 2\u25025 3\u2502<font color=red>5 4<\/font>\u25025 5\u25025 6\u25025 7\u25025 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25026 1\u2502<u>6 2<\/u>\u25026 3\u25026 4\u25026 5\u2502<u>6 6<\/u>\u25026 7\u25026 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25027 1\u25027 2\u2502<u>7 3<\/u>\u25027 4\u2502<u>7 5<\/u>\u25027 6\u25027 7\u25027 8\u2502\r\n\u251c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2524\r\n\u25028 1\u25028 2\u25028 3\u25028 4\u25028 5\u25028 6\u25028 7\u25028 8\u2502\r\n\u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2518\r\n<\/pre>\n<\/td>\n<td>&nbsp;<\/td>\n<td style=\"text-align: left;vertical-align:bottom;\">Consider a chess board as an 8<code>\u00d7<\/code>8 matrix with square (1 1) in the upper left corner and square (8 8) in the lower right corner. For those not familiar with the game a chess, the knight, generally depicted as a horse (&#x265e;), can move 2 spaces right or left and then 1 space up or down, or 2 spaces up or down and then 1 space right or left. For example, this means that a knight on the square (5 4) can move to any of the underscored squares.<\/p>\n<p>Given a 2-element vector representing the current square for a knight, return a vector of 2-element vectors representing (in any order) all the squares that the knight can move to.<\/p>\n<p>&#128161;Hint: The outer product operator<code class=\"language-apl\"> \u2218. <\/code>could be useful for generating the coordinates.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<pre><code class=\"language-apl\">   f4\u2190 {\u2193(\u2227\/q\u220a\u23738)\u233fq\u2190\u2375+\u23641\u22a2(3=+\/|t)\u233ft\u2190\u2191,\u2218.,\u2368\u00af2 \u00af1 1 2}\r\n<\/code><\/pre>\n<p><code class=\"language-apl\">f4 <\/code>derives as follows: First, generate all 16 combinations<code class=\"language-apl\"> t <\/code>of moves involving 1 and 2 steps, left and right and up and down, then select move combinations which total exactly 3 squares regardless of direction.<\/p>\n<pre><code class=\"language-apl\">   (3=+\/|t)\u233ft\u2190\u2191,\u2218.,\u2368\u00af2 \u00af1 1 2\r\n\u00af2 \u00af1\r\n\u00af2  1\r\n\u00af1 \u00af2\r\n\u00af1  2\r\n 1 \u00af2\r\n 1  2\r\n 2 \u00af1\r\n 2  1\r\n<\/code><\/pre>\n<p>The resultant 8-row matrix (call this<code class=\"language-apl\"> mv<\/code>) is added to<code class=\"language-apl\"> \u2375<\/code>, the coordinates of the current square, and then pruned to discard squares which fall outside of the chess board. The following examples illustrate the computation for<code class=\"language-apl\"> \u2375\u22615 4 <\/code>and<code class=\"language-apl\"> \u2375\u22611 2<\/code>&nbsp;:<\/p>\n<pre><code class=\"language-apl\">   mv\u2190(3=+\/|t)\u233ft\u2190\u2191,\u2218.,\u2368\u00af2 \u00af1 1 2\r\n\r\n   \u22a2 q\u2190<font color=red>5 4<\/font>+\u23641\u22a2mv                             \u22a2 q\u2190<font color=red>1 2<\/font>+\u23641\u22a2mv\r\n3 3                                       \u00af1 1\r\n3 5                                       \u00af1 3\r\n4 2                                        0 0\r\n4 6                                        0 4\r\n6 2                                        2 0\r\n6 6                                        2 4\r\n7 3                                        3 1\r\n7 5                                        3 3\r\n\r\n   \u2193(\u2227\/q\u220a\u23738)\u233fq                               \u2193(\u2227\/q\u220a\u23738)\u233fq\r\n\u250c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2510         \u250c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2510\r\n\u25023 3\u25023 5\u25024 2\u25024 6\u25026 2\u25026 6\u25027 3\u25027 5\u2502         \u25022 4\u25023 1\u25023 3\u2502\r\n\u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2518         \u2514\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2518\r\n<\/code><\/pre>\n<p>An alterative solution is to precomputing an <code>8\u00d78<\/code> table of the possible knight moves for each chess square, and then picking from the table:<\/p>\n<pre><code class=\"language-apl\">   f4i\u2190 (f4\u00a8 \u23738 8) \u2283\u2368 \u2282\r\n<\/code><\/pre>\n<p>The table look-up version would be more efficient in situations (such as in the <a href=\"https:\/\/www.jsoftware.com\/papers\/50\/50_26.htm\">Knight&rsquo;s Tour<\/a> puzzle) where the knight moves are computed repeatedly.<br \/>&nbsp;<\/p>\n<p><a name=\"5\"><\/a><\/p>\n<p><strong>5. Doubling Up<\/strong><\/p>\n<p>Given a word or a list of words, return a Boolean vector where 1 indicates a word with one or more consecutive duplicated, case-sensitive, letters. Each word will have at least one letter and will consist entirely of either uppercase (A-Z) or lowercase (a-z) letters. Words consisting of a single letter can be scalars.<\/p>\n<p>&#128161;Hint: The <em>nest<\/em> function<code class=\"language-apl\"> \u2286 <\/code>could be useful.<\/p>\n<pre><code class=\"language-apl\">   f5\u2190 (\u2228\u233f2=\u233f' ',\u22a2)\u00a8\u2218\u2286\r\n<\/code><\/pre>\n<p>A solution obtains by solving it for one word and then applying it to each word via the <em>each<\/em> operator. Since a single word argument can be a string of letters, and we don&rsquo;t want to apply the single word solution to each letter, that argument must first be converted in an enclosed word with <em>nest<\/em>. Thus the overall solution is of the form<code class=\"language-apl\"> f\u00a8\u2218\u2286<\/code>.<\/p>\n<p>For a single word, what is required is to detect <em>consecutive<\/em> duplicate letters, whence the operator<code class=\"language-apl\"> 2=\u233f\u2375 <\/code>is apt.<\/p>\n<pre><code class=\"language-apl\">   2 =\u233f 'bookkeeper'                  2 =\u233f 'radar'\r\n0 1 0 1 0 1 0 0 0                  0 0 0 0\r\n\r\n   \u2228\u233f 2 =\u233f 'bookkeeper'               \u2228\u233f 2 =\u233f 'radar'\r\n1                                  0\r\n<\/code><\/pre>\n<p>As usual, the <em>link<\/em> function <code class=\"language-apl\">{\u237a\u2375}<\/code> can be used as a generic dyadic operand function to gain additional insight into the workings of an operator:<\/p>\n<pre><code class=\"language-apl\">   2 {\u237a\u2375}\u233f 'bookkeeper'               2 {\u237a\u2375}\u233f 'radar'\r\n\u250c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u2510       \u250c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u2510\r\n\u2502bo\u2502oo\u2502ok\u2502kk\u2502ke\u2502ee\u2502ep\u2502pe\u2502er\u2502       \u2502ra\u2502ad\u2502da\u2502ar\u2502\r\n\u2514\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2518       \u2514\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2518\r\n<\/code><\/pre>\n<p><code class=\"language-apl\">2 f\u233f\u2375 <\/code>signals error on single-item arguments; moreover, it is problematic to compare a single letter against itself.  Both problems are finessed by first prefacing the argument with a space<code class=\"language-apl\"> ' '<\/code>.<\/p>\n<p>In<code class=\"language-apl\"> f5<\/code>, the train <code class=\"language-apl\">(\u2228\u233f2=\u233f' ',\u22a2)<\/code> can also be written as the equivalent dfn<code class=\"language-apl\"> {\u2228\u233f2=\u233f' ',\u2375} <\/code>as a matter of personal style. The display of a train does provide more information about how it is structured than the display of a dfn.<\/p>\n<pre><code class=\"language-apl\">   (\u2228\u233f2=\u233f' ',\u22a2)                       {\u2228\/2=\u233f' ',\u2375}\r\n\u250c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510          {\u2228\u233f2=\u233f' ',\u2375}\r\n\u2502\u250c\u2500\u252c\u2500\u2510\u2502\u250c\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\r\n\u2502\u2502\u2228\u2502\u233f\u2502\u2502\u25022\u2502\u250c\u2500\u252c\u2500\u2510\u2502\u250c\u2500\u252c\u2500\u252c\u2500\u2510\u2502\u2502\r\n\u2502\u2514\u2500\u2534\u2500\u2518\u2502\u2502 \u2502\u2502=\u2502\u233f\u2502\u2502\u2502 \u2502,\u2502\u22a2\u2502\u2502\u2502\r\n\u2502     \u2502\u2502 \u2502\u2514\u2500\u2534\u2500\u2518\u2502\u2514\u2500\u2534\u2500\u2534\u2500\u2518\u2502\u2502\r\n\u2502     \u2502\u2514\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n<\/code><\/pre>\n<p><a name=\"6\"><\/a><\/p>\n<p style=\"margin:2em 0 1em 0;\"><strong>6. Telephone Names<\/strong><\/p>\n<table style=\"margin:0;\">\n<tr>\n<td>\n<pre class=\"language-apl\">\r\n\u250c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2510\r\n\u2502    \u2502ABC\u2502DEF \u2502\r\n\u2502 1  \u2502 2 \u2502 3  \u2502\r\n\u251c\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524\r\n\u2502GHI \u2502JKL\u2502MNO \u2502\r\n\u2502 4  \u2502 5 \u2502 6  \u2502\r\n\u251c\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524\r\n\u2502PQRS\u2502TUV\u2502WXYZ\u2502\r\n\u2502 7  \u2502 8 \u2502 9  \u2502\r\n\u251c\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2524\r\n\u2502    \u2502   \u2502    \u2502\r\n\u2502 *  \u2502 0 \u2502 #  \u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2518\r\n<\/pre>\n<\/td>\n<td>&nbsp;<\/td>\n<td style=\"text-align:left;\">\nSome telephone keypads have letters of the alphabet embossed on their keytops. Some people like to remember phone numbers by converting them to an alphanumeric form using one of the letters on the corresponding key. For example, in the keypad shown,<code class=\"language-apl\"> 'ALSMITH' <\/code>would correspond to the number 257-6484 and <code class=\"language-apl\"> '1DYALOGBEST' <\/code>would correspond to 1-392-564-2378. Write an APL function that takes a character vector right argument that consists of digits and uppercase letters and returns an integer vector of the corresponding digits on the keypad.<\/p>\n<p>&#128161;Hint: Your solution might make use of the membership function <code class=\"language-apl\">\u220a<\/code>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<pre><code class=\"language-apl\">   f6\u2190 {(\u2375\u2378\u2368\u2395d,'ADGJMPTW')-9*\u2375\u220a\u2395a}\r\n<\/code><\/pre>\n<p>Letters and digits alike are mapped to integer indices using the <em>interval index<\/em> function<code class=\"language-apl\"> \u2378<\/code>, which neatly handles the irregularly-sized intervals (see <a href=\"#2\">problem 2 above<\/a>). The indices are then decremented by 9 for letters and by 1 for digits.<\/p>\n<p>The expression <code class=\"language-apl\">9*\u2375\u220a\u2395a<\/code> illustrates a common technique in APL used to implement array logic, effecting control flow without using control structures or explicit branching. In the following, <code class=\"language-apl\">c<\/code> and <code class=\"language-apl\">d<\/code> are scalars (usually numbers) and <code class=\"language-apl\">\u2375<\/code> is a boolean array.<\/p>\n<style>\n.leftText tr td{text-align:left;}\n<\/style>\n<table class=\"leftText\">\n<tr>\n<td valign=top><code class=\"language-apl\">c*\u2375<\/code><\/td>\n<td>\n<code class=\"language-apl\">c <\/code>where<code class=\"language-apl\"> \u2375 <\/code>is<code class=\"language-apl\"> 1 <\/code>and<code class=\"language-apl\"> 1 <\/code>where<code class=\"language-apl\"> \u2375 <\/code>is<code class=\"language-apl\"> 0<\/code>.\n <\/td>\n<\/tr>\n<tr>\n<td valign=top><code class=\"language-apl\">c\u00d7\u2375<\/code><\/td>\n<td>\n<code class=\"language-apl\">c <\/code>where<code class=\"language-apl\"> \u2375 <\/code>is<code class=\"language-apl\"> 1 <\/code>and<code class=\"language-apl\"> 0 <\/code>where<code class=\"language-apl\"> \u2375 <\/code>is<code class=\"language-apl\"> 0<\/code>.\n <\/td>\n<\/tr>\n<tr>\n<td valign=top nowrap><code class=\"language-apl\">c+\u2375\u00d7d-c &nbsp;<\/code><\/td>\n<td>\n<code class=\"language-apl\">c <\/code>where<code class=\"language-apl\"> \u2375 <\/code>is<code class=\"language-apl\"> 0 <\/code>and<code class=\"language-apl\"> d <\/code>where<code class=\"language-apl\"> \u2375 <\/code>is<code class=\"language-apl\"> 1<\/code>.\n <\/td>\n<\/tr>\n<tr>\n<td valign=top nowrap><code class=\"language-apl\">(c,d)[1+\u2375] &nbsp;<\/code><\/td>\n<td>\nSame as<code class=\"language-apl\"> c+\u2375\u00d7d-c<\/code>, but<code class=\"language-apl\"> c <\/code>and<code class=\"language-apl\"> d <\/code>can be any scalars. The<code class=\"language-apl\"> 1+ <\/code>is omitted if the index origin<code class=\"language-apl\"> \u2395io <\/code>is<code class=\"language-apl\"> 0<\/code>.\n <\/td>\n<\/tr>\n<\/table>\n<p><\/p>\n<p><a name=\"7\"><\/a><\/p>\n<p><strong>7. In the Center of It All<\/strong><\/p>\n<p>Given a right argument of a list of words (or possibly a single word) and a left argument of a width, return a character matrix that has width columns and one row per word, with each word is centered within the row. If width is smaller than the length of a word, truncate the word from the right. If there are an odd number of spaces to center within, leave the extra space on the right.<\/p>\n<p>&#128161;Hint: The <em>mix<\/em><code class=\"language-apl\"> \u2191 <\/code>and <em>rotate<\/em><code class=\"language-apl\"> \u233d <\/code>functions will probably be useful here.<\/p>\n<pre><code class=\"language-apl\">   f7\u2190 {(\u2308\u00af0.5\u00d70\u2308\u237a-\u2262\u00a8\u2375)\u233d\u2191\u237a\u2191\u00a8\u2375}\u2218\u2286\r\n<\/code><\/pre>\n<p>As in <a href=\"#5\">problem 5<\/a>, a prefatory application of <em>nest<\/em><code class=\"language-apl\"> \u2286 <\/code>converts an argument of a single word into a more manageable standard of a list of words. Subsequently, the right argument is turned into a matrix, each row padded with spaces on the right (or truncated). Each row is then rotated so that the non-blank characters are centered. The finicky detail of an odd number of spaces is resolved by using<code class=\"language-apl\"> \u2308 <\/code>or<code class=\"language-apl\"> \u230a <\/code>in the calculation of the amounts of rotation.\n<\/p>\n<p><a name=\"8\"><\/a><\/p>\n<p><strong>8. Going the Distance<\/strong><\/p>\n<p>Given a vector of (X Y) points, or a single X Y point, determine the total distance covered when travelling in a straight line from the first point to the next one, and so on until the last point, then returning directly back to the start. For example, given the points <\/p>\n<pre><code class=\"language-apl\">   (A B C)\u2190 (\u00af1.5 \u00af1.5) (1.5 2.5) (1.5 \u00af1.5)\r\n<\/code><\/pre>\n<p>the distance<code class=\"language-apl\"> A <\/code>to<code class=\"language-apl\"> B <\/code>is 5,<code class=\"language-apl\"> B <\/code>to<code class=\"language-apl\"> C <\/code>is 4 and<code class=\"language-apl\"> C <\/code>back to<code class=\"language-apl\"> A <\/code>is 3, for a total of 12.<\/p>\n<p>&#128161;Hint: The <em>rotate<\/em><code class=\"language-apl\"> \u233d <\/code>and <em>power<\/em><code class=\"language-apl\"> * <\/code>functions might be useful.<\/p>\n<pre><code class=\"language-apl\">   f8\u2190 {+\u233f 2 {0.5*\u2368+.\u00d7\u2368\u237a-\u2375}\u233f \u2375\u236a1\u2191\u2375}\r\n<\/code><\/pre>\n<p>The result obtains by applying the distance function<code class=\"language-apl\"> d\u2190{0.5*\u2368+.\u00d7\u2368\u237a-\u2375} <\/code>between pairs of points, taking care to return to the start.<\/p>\n<p>As in <a href=\"#5\">problem 5<\/a>, the expression<code class=\"language-apl\"> 2 f\u233f\u2375 <\/code>is just the ticket for working with consecutive items in the argument and, again, using the link function<code class=\"language-apl\"> {\u237a\u2375} <\/code>elucidates the workings of an operator:<\/p>\n<pre><code class=\"language-apl\">   (A B C)\u2190 (\u00af1.5 \u00af1.5) (1.5 2.5) (1.5 \u00af1.5)\r\n\r\n   2 {\u237a\u2375}\u233f A B C A\r\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n\u2502\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\u2502\r\n\u2502\u2502\u00af1.5 \u00af1.5\u25021.5 2.5\u2502\u2502\u25021.5 2.5\u25021.5 \u00af1.5\u2502\u2502\u25021.5 \u00af1.5\u2502\u00af1.5 \u00af1.5\u2502\u2502\r\n\u2502\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2502\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2502\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n   2 d\u233f A B C A\r\n5 4 3\r\n\r\n   A d B              B d C              C d A\r\n5                  4                   3\r\n\r\n   f8 A B C\r\n12\r\n\r\n<\/code><\/pre>\n<p><a name=\"9\"><\/a><\/p>\n<p><strong>9. Area Code &agrave; la Gauss<\/strong><\/p>\n<p>Gauss&rsquo;s area formula, also known as the <a target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Shoelace_formula\">shoelace formula<\/a>, is an algorithm to calculate the area of a simple polygon (a polygon that does not intersect itself). It&rsquo;s called the shoelace formula because of a common method using matrices to evaluate it. For example, the area of the triangle described by the vertices<code class=\"language-apl\"> (2&nbsp;4) (3&nbsp;\u00af8) (1&nbsp;2) <\/code>can be calculated by &ldquo;walking around&rdquo; the perimeter back to the first vertex, then drawing diagonals between the columns. The pattern created by the intersecting diagonals resembles shoelaces, hence the name &ldquo;shoelace formula&rdquo;.\n<\/p>\n<p>&#128161;Hint: You may want to investigate the <em>rotate first<\/em><code class=\"language-apl\"> \u2296 <\/code>function.<\/p>\n<p><!-- BEGIN Shoelace method table--><\/p>\n<style>\n#shoelace {\n  background: #f5f2f0;\n  border-left: 3px solid #fc9732!important;\n  border: solid 1px #ccc;\n}\n#shoelace pre {\n  font: 13px 'APL385', monospace !important;\n  text-align: left;\n  border: none;\n  background: none;\n  margin-bottom: 0;\n}\n#shoelace > tbody > tr > td {\n  text-align: left;\n  padding-left: 1ex;\n  border-bottom: solid 1px #ccc;\n}\n#shoelace .nwse, swne {\n  width: 0;\n  padding: 0;\n}\n#shoelace .nwse {\n  transform: rotate(-55deg) translate(-1.2ex, 0.5ex);\n  color: #928ABD;\n}\n#shoelace .swne {\n  transform: rotate(55deg) translate(1.4ex,1.3ex);\n  color: #ed7f00;\n}\n#shoelace .nwse:nth-child(3) {\n  left: -0.7ex;\n}\n#shoelace .swne.last {\n  left: 0.6ex;\n}\n.apl td {\n  padding: 0.2ex 0.3ex 0.5ex 0;\n  top: 1.3ex;\n  position: relative;  \n  font-family: \"APL385 Unicode\";\n  color: black;\n  text-align: left;\n}\n<\/style>\n<table id=\"shoelace\">\n<tr>\n<td>First place the vertices in order above each other:<\/td>\n<td>\n<table class=\"apl\">\n<tr>\n<td>2<\/td>\n<td><\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td><\/td>\n<td>\u00af8<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td><\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><\/td>\n<td>4<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n      Sum the products of the numbers connected by the diagonal lines going down and to the right:<\/p>\n<pre>\r\n      (2\u00d7\u00af8)+(3\u00d72)+(1\u00d74)\r\n\u00af6\r\n      <\/pre>\n<\/td>\n<td>\n<table class=\"apl\">\n<tr>\n<td>2<\/td>\n<td class=\"nwse\">\u2502<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td class=\"nwse\">\u2502<\/td>\n<td>\u00af8<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td class=\"nwse\">\u2502<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><\/td>\n<td>4<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td>\n      Next sum the products of the numbers connected by the diagonal lines going down and to the left: <\/p>\n<pre>\r\n      (4\u00d73)+(\u00af8\u00d71)+(2\u00d72)\r\n8\r\n      <\/pre>\n<\/td>\n<td>\n<table class=\"apl\">\n<tr>\n<td>2<\/td>\n<td class=\"swne\">\u2502<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td class=\"swne\">\u2502<\/td>\n<td>\u00af8<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td class=\"swne\">\u2502<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><\/td>\n<td>4<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<tr>\n<td> <!------------------------------------------><br \/>\n      Finally, halve the absolute value of the difference between the two sums:  <\/p>\n<pre>\r\n      0.5 \u00d7 | \u00af6 - 8\r\n7\r\n      <\/pre>\n<\/td>\n<td>\n<table class=\"apl\">\n<tr>\n<td>2<\/td>\n<td class=\"swne last\">\u2502<\/td>\n<td class=\"nwse\">\u2502<\/td>\n<td>4<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td class=\"swne last\">\u2502<\/td>\n<td class=\"nwse\">\u2502<\/td>\n<td>\u00af8<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td class=\"swne last\">\u2502<\/td>\n<td class=\"nwse\">\u2502<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td><\/td>\n<td><\/td>\n<td>4<\/td>\n<\/tr>\n<\/table>\n<\/td>\n<\/tr>\n<\/table>\n<p><!-- END Shoelace method table--><\/p>\n<p>Given a vector of <code class=\"apl\">(X Y)<\/code> points, or a single <code class=\"apl\">X Y<\/code> point, return a number indicating the area circumscribed by the points.<\/p>\n<pre><code class=\"language-apl\">   f9\u2190 {0.5\u00d7|(+\/\u00d7\/\u00af1\u21930 1\u2296t)-+\/\u00d7\/1\u21930 \u00af1\u2296t\u2190\u2191(\u22a2,1\u2218\u2191)\u2286\u2375}\r\n<\/code><\/pre>\n<p>There is an alternative solution using the <em>determinant<\/em> function and the <em>stencil<\/em> operator <code class=\"language-apl\">\u233a<\/code>&nbsp;:<\/p>\n<pre><code class=\"language-apl\">   )copy dfns det    \u235d or  det\u2190 (-\/)\u2218(\u00d7\/)\u2218(0 1\u2218\u2296)\r\n   x\u2190 (2 4) (3 \u00af8) (1 2)\r\n\r\n   {det \u2375}\u233a2 \u2191x\u236a1\u2191x\r\n\u00af28 14 0\r\n\r\n   2 \u00f7\u2368| +\/ {det \u2375}\u233a2 \u2191x\u236a1\u2191x\r\n7\r\n   f9 x\r\n7\r\n<\/code><\/pre>\n<p>Putting it together:<\/p>\n<pre><code class=\"language-apl\">   f9a\u2190 {2\u00f7\u2368|+\/ {det \u2375}\u233a2 \u2191\u2375\u236a1\u2191\u2375}\r\n   f9b\u2190 {2\u00f7\u2368 +\/ {det \u2375}\u233a2 \u2191\u2375\u236a1\u2191\u2375}\r\n\r\n   f9a x\r\n7\r\n   f9b x\r\n\u00af7\r\n   f9b \u2296t\r\n7\r\n<\/code><\/pre>\n<p><code class=\"language-apl\">f9a <\/code>computes the absolute area as specified by the problem.<code class=\"language-apl\"> f9b <\/code>computes the <em>signed area<\/em> by omitting the absolute value function<code class=\"language-apl\"> |<\/code>&nbsp;.<code class=\"language-apl\"> <\/code> Commonly, the signed area is positive if the vertices are ordered counterclockwise and is negative otherwise. See the Wikipedia article on <a href=\"http:\/\/en.wikipedia.org\/wiki\/Polygon#Area\">polygons<\/a> for more details.<\/p>\n<p>Similar to<code class=\"language-apl\"> 2 f\u233f\u2375 <\/code>(<a href=\"#5\">problem 5<\/a>), the workings of <em>stencil<\/em> can be elucidated by using<code class=\"language-apl\"> {\u2282\u2375} <\/code>as a generic monadic operand function:<\/p>\n<pre><code class=\"language-apl\">   {\u2282\u2375}\u233a2 \u2191x\u236a1\u2191x\r\n\u250c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2510\r\n\u25022  4\u25023 \u00af8\u25021 2\u2502\r\n\u25023 \u00af8\u25021  2\u25022 4\u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2518\r\n   {det \u2375}\u233a2 \u2191x\u236a1\u2191x\r\n\u00af28 14 0\r\n\r\n   det \u2191 (2 4) (3 \u00af8)       det \u2191 (3 \u00af8) (1 2)       det \u2191 (1 2) (2 4)\r\n\u00af28                      14                        0\r\n\r\n<\/code><\/pre>\n<p><a name=\"10\"><\/a><\/p>\n<p><strong>10. Odds &amp; Evens<\/strong><\/p>\n<p>Given a vector of words, separate the words into two vectors&mdash;one containing all the words that have an odd number of letters and the other containing all the words that have an even number of letters.<\/p>\n<p>&#128161;Hint: You may want to look into the dyadic form of the <em>key<\/em> operator<code class=\"language-apl\"> \u2338<\/code>.\n<\/p>\n<pre><code class=\"language-apl\">   f10\u2190 1 \u2193\u00a8 (1 0,2|\u2262\u00a8) {\u2282\u2375}\u2338 1 0\u2218,\r\n<\/code><\/pre>\n<p>The solution is required to have exactly two items, words of odd lengths and words of even lengths. This required form is ensured by prefacing the left and right argument to <em>key<\/em> by<code class=\"language-apl\"> 1&nbsp;0<\/code>, then dropping the first item from each of the resultant two parts. (See also <a href=\"#3\">problem 3 above<\/a>.)<\/p>\n<p><a name=\"nextTime\"><\/a><\/p>\n<p><strong>Editor&#8217;s Addendum: Phase II Questions<\/strong><\/p>\n<p>You can watch the 2019 Grand Prize Winner Jamin Wu&#8217;s Dyalog &#8217;19 acceptance presentation and explanation of how he approached the phase II questions on <a target=\"_blank\" href=\"https:\/\/dyalog.tv\/Dyalog19\/?v=ROew12QoHs8\">Dyalog.tv<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The following are my attempts at the Phase I problems of the 2019 APL Problem Solving Competition. There are not necessarily &ldquo;right answers&rdquo; as personal style and taste come into play. More explanation of the code is provided here than &hellip; <a href=\"https:\/\/www.dyalog.com\/blog\/2020\/02\/2019-apl-problem-solving-competition-phase-i-problems-sample-solutions\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-6366","post","type-post","status-publish","format-standard","hentry","category-student-competition"],"_links":{"self":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/6366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/comments?post=6366"}],"version-history":[{"count":12,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/6366\/revisions"}],"predecessor-version":[{"id":6378,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/6366\/revisions\/6378"}],"wp:attachment":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/media?parent=6366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/categories?post=6366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/tags?post=6366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}