5. Turn Around
In this problem, you’re asked to enter an APL expression (some APL code), including arguments (data given to APL symbols). Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.
So far, every function you have seen has had two arguments, one on its left and one on its right. However, some functions only take a single argument, which is on its right. An example of such a function is ⌽ (Mirror, which looks like a half-circle being reflected in a vertical mirror); this function mirrors its single argument horizontally. For example, ⌽ 1 2 3 gives 3 2 1 and ⌽ [1 2 3 ⋄ 4 5 6] gives [3 2 1 ⋄ 6 5 4].
Write an expression that uses = (from problem 3), ⌽, and + with / (from problem 4) to compare the list 3 1 4 1 5 with its mirrored version (⌽ 3 1 4 1 5). It should give a count of how many corresponding numbers are the same in the original list as in the mirrored list. The result should be 3:
1; the second number in both3 1 4 1 5and⌽ 3 1 4 1 54; the third number in both3 1 4 1 5and⌽ 3 1 4 1 51; the fourth number in both3 1 4 1 5and⌽ 3 1 4 1 5