Skip to content

APL Quest 2016 Problems

2016-1: Statistics - Mean:

Write a function that takes a numeric array as its right argument and returns the mean (average) of the array.

2016-2: Statistics - Median:

Write a function that takes a numeric vector as its right argument and returns the median of the array.

2016-3: Statistics - Mode:

Write a function that takes a numeric vector or scalar as its right argument and returns the mode (that is, the most common value) of the array.

2016-4: Just Meshing Around:

Write a function that takes vectors as its left and right arguments and returns them “meshed” into a single vector formed by alternately taking successive elements from each argument.

2016-5: You're Unique, Just Like Everyone Else:

Write a function that takes a vector as its right argument and returns elements that occur only once in the vector.

2016-6: Shorter Ones to the Front:

Write a function that takes a vector of vectors as its right argument and returns it sorted by the length of each element.

2016-7: 3s and 5s:

Write a function that takes a numeric vector and returns all elements that are divisible by 3 or 5.

2016-8: Separating Out the Negative:

Write a function that takes a numeric vector and returns a two element vector whose first element contains the values less than 0 (zero) in the vector and the second element contains all values greater than or equal to 0.

2016-9: Delimited Text:

Write a function that takes a character vector as its right argument and one or more characters as its left argument, where those characters are delimiters in the right argument.

2016-10: Order Total :

Write a function that takes as its right argument a vector of prices and as its left argument a numeric vector that indicates the number ordered and returns the total cost for the order.