Skip to content

APL Quest 2023 Problems

2023-1: Elimination Sort:

Write a function that takes a non-empty numeric vector right argument and returns an "Elimination-sorted" vector of the right argument.

2023-2: Put It In Reverse:

Write a function that takes takes a scalar or vector arguments and returns a Boolean result that is the same shape as the right argument where 1's mark the ends of occurrences of the left argument in the right argument.

2023-3: Caesar Salad:

Write a function that takes a single integer left argument representing the size of the shift and takes a character vector right argument representing the plaintext message and returns a result with the same shape as the right argument representing the encrypted message.

2023-4: Like a Version:

Write a function that compares two 3-element integer vectors representing major versions, minor versions, and build numbers.

2023-5: Risky Business:

Write a function that takes non-empty, descending integer vectors representing the attacker's and defender's dice rolls and returns a 2-element vector where the first element represents the number of armies the attacker lost and the second element represents the number of armies the defender lost.

2023-6: Key/Value Pairs:

Write a function that takes a 2-element character vector left argument where the first element represents the separator character between multiple key/value pairs and the second element represents the separator between the key and the value for each pair and takes a character vector right argument representing a valid set of key/value pairs (delimited as specified by the left argument) and returns a 2-column matrix where the first column contains the character vector keys of the key/value pairs and the second column contains the character vector values.

2023-7: Let's Be Rational:

Write a function that takes a single non-zero positive number right argument and returns a 2-element "integer" result representing the smallest non-zero positive values for p and q respectively.

2023-8: Critical Thinking:

Write a function that takes a 3-element integer left argument representing a valid birthdate and 3-element integer right argument representing a valid date occurring on or after the left argument and returns a 3-element integer array representing the date of the next double or triple critical day occurring on or after the date represented by the right argument.

2023-9: Flipping Pairs:

Write a function that takes a non-empty non-scalar array right argument and returns an array of the same shape as the argument, but with pairs of elements along the last axis "flipped".

2023-10: Partition with a Twist:

Write a function that takes a non-negative integer and a space-delimited character vector and splits the character vector into the given number of sub-strings.