1: Are You There?
2: Are They There?
3: Summation
4: How Many?
5: Windows
6: Tag Along
7: Tag Me
8: Play Tag
9: DNA
10: Wolfram
Your Answers
LocalStorage is disabled or you are using an old browser. Please register (and log in) to have your solutions saved.
APL Logo

Welcome to the APL Challenge!

The current round (2025.3) ends on Friday 31 October 2025 at 09:00 UTC.

APL is a programming language that will change the way you think about solving problems.

The APL Challenge has been made for those that don’t know APL yet. You don’t need to know any programming either. We’ll teach everything you need to know as you go along.

You don’t need to solve every problem, but every one you do, gives you a chance to win one of three USD 100 prizes. Winners are also listed on our website.

Solving the problems

You can use TryAPL to experiment and find a solution to each problem, then copy it onto the problem page. You can also just write a solution into the input field directly. Either way, you can write APL symbols by clicking on the language bar above the area where you write APL code.

Several problems include some data (text or numbers) you need. You should be able to copy data with an icon like this by clicking on it, but note that not all browsers allow this.

Testing and submitting your solutions

You don't need to register to start (most browsers will store your answers until you register) but you must be registered and logged in to submit your answers. However, you can test your answer using the  Test button.

You can test and submit your answer using the  Submit button. The system will only allow you to submit correct answers.

Prizes

After each round, Dyalog Ltd awards up to three USD 100 prizes.

Anyone can win a prize except Dyalog employees and associates. We reserve the right to choose the winners at our sole discretion and will not enter into conversation about our choices.

All prizes are denominated in U.S. dollars, but can be awarded in U.S. dollars (USD), pounds sterling (GBP) or euros (EUR) by electronic transfer to a bank account or a PayPal account. No other forms of payment will be made.

If you are selected as a winner but are unable or unwilling to accept the prize, you cannot transfer the prize or designate someone else as the winner. Prizes must be claimed within three weeks of being notified or you forfeit the right to that prize.

If you accept a prize, you will be solely responsible for all applicable taxes related to accepting that prize.

Detailed rules

Conditions

Each round stands on its own; participants can enter a single or multiple rounds independently.

All participants must submit to these rules.

Multiple registrations to a single round are not allowed.

Participants must not publish their solutions prior to the end of the challenge round. Doing so will be considered grounds for disqualification from the challenge round.

Only entries that are received by the deadline are eligible. We cannot accept responsibility for entries that are lost, delayed or damaged. Proof of sending an online entry is not proof that we received it.

Entries not submitted in accordance with these terms and all other rules and directions (at the sole discretion of Dyalog Ltd) will be excluded from the challenge round.

Frequently Asked Questions (FAQ)

I’m stuck. Can you help?

In fairness to all, we cannot provide guidance to specific issues. However, everything you need to know should be included either on the page of your current problem or on one of the previous problem pages.

Can I collaborate with my friends?

Yes. However, a submission can only be made by a single person and only that person will be eligible for a prize. Each collaborator can submit an entry.

Why is my correct answer not accepted?

The purpose of the APL Challenge is to teach specific parts of APL, so we require solutions that use the techniques we teach. Most problems can be solved in many ways, and the techniques we teach here do not necessarily lead to the best code. If you want to explore alternative answers, then you can use TryAPL to do so.

Why can I not change my answer?

When you test or submit a correct answer, we lock it down for you, so it isn’t accidentally overwritten with an incorrect answer. All correct answers are equally eligible for winning. If you want to explore alternative answers, then you can use TryAPL to do so.

Does the possibility of winning prize money classify as commercial use of Dyalog?

No.

I didn’t win a prize. Can I try again?

Yes. There are four rounds of the APL Challenge each year and each runs for three months. You are free to enter subsequent rounds whether or not you’ve participated in or won a prize in a previous round.

What do I do if there is a problem with this website?

Please report any problems to challenge@dyalog.com.

I did not receive an email with a code when registering. What should I do?

Click Register again and wait for 5–10 minutes. Make sure you check your spam folder. If the code still doesn't come through, then please report the problem to challenge@dyalog.com.

Data protection and cookies

We use cookies to keep you logged in and to retain your solutions. By using this site, you agree to this.

We only collect the data necessary for the competition to run, and will use any personal information submitted in accordance with Dyalog Ltd's Privacy Policy.

At any time after you have registered and are logged in, you can erase all data that is stored about you as part of the competition by clicking the user button email@domain.com in the top right corner and selecting Erase account and data.

Consent to usage of information

By participating in the challenge, you consent to the use by Dyalog Ltd of all text and code that you submit, for any purpose, in any media, for an unlimited period, without remuneration. We have the right to publish, display, reproduce, adapt, promote or otherwise use entries in any way we deem fit. You warrant that you are legally entitled to grant these rights to us and agree to indemnify us in the event that we suffer any loss as a result of false information you provide.

By participating in the challenge, you agree that if you win and subsequently participate in any promotional activities or material, you will do so without additional payment or permission.

Disclaimers

We are not liable for any damage, loss or disappointment suffered by you for taking part or not being able to take part in this competition.

In the event of unforeseen circumstances, we may alter, amend or cancel the competition without prior notice.

We reserve the right to change these terms at any time.

These terms are governed by the Laws of England and Wales and all disputes subject to the jurisdiction of the courts of England and Wales.

Contact

If you have feedback, or would like to ask a question that is not already answered here, please e-mail challenge@dyalog.com.

image/svg+xml
APL Challenge 2025.3

Note: In this problem, you’re asked to enter some APL code, including an APL symbol and the data (text or numbers) given to it. Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.


1: Are You There?

It is easy to look for things in APL. Think of it as looking for some pencils in a drawer. We use the symbol which looks like the E in Exists In. If we use a pencils and drawer example, the symbol tells you which pencils are in the drawer. The pencils (what you are looking for) are on the left of the symbol and the drawer (what you are looking in) is to the right of the symbol. This will give you a 1 for each pencil that was found in the drawer and a 0 for each pencil that was not found in the drawer. For example, 1 16 12 ∊ 12 25 1 12 15 7 gives 1 0 1 as follows:

  1. 1 because 1 was found in 12 25 1 12 15 7
  2. 0 because 16 was not found in 12 25 1 12 15 7
  3. 1 because 12 was found in 12 25 1 12 15 7

In APL, a text is a list of letters and must be between single quotes ( ' ). For example, 'ABC' will give a result that looks like ABC.


Write some APL code that uses to check which letters of 'DYALOG IN USE' appear in the list of vowels ('AEIOU'). The result should be 0 0 1 0 1 0 0 1 0 0 1 0 1 as follows:

  1. 0 because 'D' is not a vowel
  2. 0 because 'Y' is not a vowel
  3. 1 because 'A' is a vowel
  4. 0 because 'L' is not a vowel
  5. 1 because 'O' is a vowel
  6. 0 because 'G' is not a vowel
  7. 0 because ' ' is not a vowel
  8. 1 because 'I' is a vowel
  9. 0 because 'N' is not a vowel
  10. 0 because ' ' is not a vowel
  11. 1 because 'U' is a vowel
  12. 0 because 'S' is not a vowel
  13. 1 because 'E' is a vowel
Answer:Answer:

In this problem, you’re asked to enter some APL code, including an APL symbol and the data (text or numbers) given to it. Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.


2: Are They There?

In problem 1 you saw a list created by putting numbers next to each other with a space between them. You can also have a list of multiple texts. For example, 'here' 'we' 'are' is a list of three texts; 'here', 'we', and 'are'. Since a text is a letter list, a list of texts is a list of letter lists.

works with any sort of list and list of lists, for example, a list of number lists. You can create a list of number lists by writing each inner list in round brackets. For example, (10 1) (222 200 2) (30 30) is a list of these three number lists:

  1. 10 1
  2. 22 200 2
  3. 30 30

Write some APL code that uses to find out which of the texts 'TO' 'BE' 'OR' 'NOT' 'TO' 'BE' appear among the texts 'HERE' 'BE' 'DRAGONS'. The result should be 0 1 0 0 0 1.

Answer:Answer:

In this problem, you’re asked to enter some APL code, including an APL symbol and the data (text or numbers) given to it. Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.


3: Summation

Finding the product of a list of numbers means using × to multiply them together. You write this as ×/ (times slash) to the left of the numbers. For example, the product of 3 1 4 1 5 can be found with ×/ 3 1 4 1 5 (the product is 60).

Whatever mathematical operation symbol is to the left of the / will be inserted between the numbers.


Write some APL code that uses / to find the sum of 3 1 4 1 5 by adding the numbers together. The result should be 14.

Answer:Answer:

Note: 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.


4: How Many Are There?

Symbols that are used to change data are called functions.

An APL function takes the result of all code to its right as its right argument (the data on the right of the symbol). For example, 2×3+4 gives 14 (rather than the 10 you might expect) because the × takes the result of 3+4 as its right argument. Similarly, -2-6 gives 4 because the left - negates the result of 2-6.


Write an expression that uses what you learnt in problem 3 and from problem 1 to count how many of the texts 'TO' 'BE' 'OR' 'NOT' 'TO' 'BE' appear among the texts 'HERE' 'BE' 'DRAGONS'. The result should be 2.

Answer:Answer:

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.

5: Windows

In problem 3 you saw how ×/ multiplies all the numbers in a list (giving the product) and how any mathematical operation symbol can be used instead of times. Sometimes, you only want to multiply a limited number of adjacent elements. For example, you might want to find the product of each number and its neighbour. We can tell / (slash) to apply its function over each “window” of a given size by putting the size on the left of the function. Since a number and its neighbour together are 2 numbers, 2 ×/ 3 2 5 4 4 3 finds the product of each number in 3 2 5 4 4 3 and its neighbour, which gives 6 10 20 16 12, because:

  1. 3×2 is 12
  2. 2×5 is 16
  3. 5×4 is 20
  4. 4×4 is 10
  5. 4×3 is 6

Similarly, we can find the product of every window of size 4 with 4 ×/ 3 2 5 4 4 3 which gives 120 160 240, because:

  • 3×2×5×4 is 120
  • 2×5×4×4 is 160
  • 5×4×4×3 is 240
The result is always shorter than the argument. The exact length depends on the window size.

Use / to find the sum of every window of size 5 in the list 1 0 1 2 2 0 1 2. The result should be 6 5 6 7.

Answer:Answer:

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.


6: Tag Along

You can join things (letters, numbers, lists, and so on) together by putting a , (comma) between them. For example, 1 , 2 gives 1 2 and 1 2 , 3 4 gives 1 2 3 4.


Websites are written in a language called HTML using tags. A tag consists of a less-than symbol, a tag name, and a greater-than symbol. For example, the HTML tag for an image is <img>.

Using , create an HTML image tag by joining together the three texts '<' and 'img' and '>'. The result should be <img>.

Answer:Answer:

Note: In this problem, you’re asked to enter your own APL function, without giving it any arguments. Your function will be checked by the APL Challenge system using several tests to see whether it is correct.


7: Tag me

You can create your own function by putting an expression in curly brackets. For example, the expression 2+3 becomes the function {2+3}. Within this function, any (omega, the right-most letter of the Greek alphabet) is replaced by the argument to the right of the closing curly bracket ( } ).

For example, a function that multiplies its argument by two could be written {2×⍵}, so {2×⍵} 5 gives 10.


Using what you learnt in problem 6, write a function that takes an HTML tag name and creates the HTML tag. For example:

      {answer} 'img'
<img>

      {answer} 'button'
<button>

      {answer} 'input'
<input>
Answer:Answer:

In this problem, you’re asked to enter your own APL function, without giving it any arguments. Your function will be checked by the APL Challenge system using several tests to see whether it is correct.


8: Play Tag

In problem 7, you saw how to write a function that takes a right argument using . If you want to create a function that also takes a left argument, use (alpha; the left-most letter of the Greek alphabet). For example, a function that sums its left and right arguments and then multiplies by 2 could be written {2×⍺+⍵}.


HTML content is usually between a regular tag and its corresponding closing tag. A closing tag is just like a normal tag, except that it has a slash before its name. For example, the closing tag for a button is </button>.

Using what you’ve learnt so far, write a function that takes an HTML tag name as its right argument and content as its left argument. It must join a tag (see problem 6) with the content and a corresponding closing tag. For example:

      'use it wisely' {answer} 'head'
<head>use it wisely</head>

      'heavy lifting' {answer} 'strong'
<strong>heavy lifting</strong>

      'a bridge too far' {answer} 'span'
<span>a bridge too far</span>
Answer:Answer:

Note: In this problem, you’re asked to enter your own APL function, without giving it any arguments. Your function will be checked by the APL Challenge system using several tests to see whether it is correct.


9: DNA

Using / doesn't always give a single value. If the function used returns a list, then you get a list result. If you give a window size, as in problem 5, you get a list of lists (remember that a text is just a list of letters).

Genes are grouped into codons which are three DNA letters in a row. Reading can begin at any point in the DNA code, so to find all possible codons, you need to read three letters starting from every base, except the last two. For example, the DNA string 'ACCTGGCCT' has the following possible codons:

  1. 'ACC'
  2. 'CCT'
  3. 'CTG'
  4. 'TGG'
  5. 'GGC'
  6. 'GCC'
  7. 'CCT'

Note that there can be duplicate codons, and the number of codons is smaller than the number of given DNA letters.


From the functions you’ve learnt in the earlier problems, find one to use with / so that you can write a function that takes a DNA string and gives all the possible codons. For example:

      {answer} 'GTTTCGGTG'
┌───┬───┬───┬───┬───┬───┬───┐
│GTT│TTT│TTC│TCG│CGG│GGT│GTG│
└───┴───┴───┴───┴───┴───┴───┘

      {answer} CCCACT
┌───┬───┬───┬───┐
│CCC│CCA│CAC│ACT│
└───┴───┴───┴───┘

      {answer} 'GATTACA'
┌───┬───┬───┬───┬───┐
│GAT│ATT│TTA│TAC│ACA│
└───┴───┴───┴───┴───┘
Answer:Answer:

In this problem, you’re asked to enter your own APL function, without giving it any arguments. Your function will be checked by the APL Challenge system using several tests to see whether it is correct.


10: Wolfram Rules

Remember from problem 2 that round brackets are used to make a list of number lists.

You can also use round brackets to change the order in which things are calculated. In problem 4 you learnt that an APL function takes the result of all code to its right as its right argument. This was a simplification; the right argument only goes as far as the nearest closing bracket ) on its right:

  • 2×3+4 gives 14 because × takes the result of all code to its right, 3+4, as its right argument.
  • 2×(3+4) gives 14 because × takes the result of all code to its right, (3+4), as its right argument.
  • (2×3)+4 gives 10 because the right argument of × only goes as far as the nearest closing bracket.

You will be writing the code for rules invented by Stephen Wolfram. Each set of rules shows how to change a list of 0s and 1s into a new list of the same length, again only with 0s and 1s. For every number in the given list, you need to look at it together with its neighbours to the left and right, then check whether this triplet of numbers exists in a given list of triplets. If found, that number becomes a 1. Otherwise it becomes a 0. Consider the first number to have an invisible 0 on its left and the last number to have an invisible 0 on its right.

Using everything that you’ve learnt so far, write a function that takes a rule set and an initial list, and then calculates a new list based on those. The rule set will be the left argument, and is a list of lists of 0s and 1s. The initial list is the right argument, and is a simple list of 0s and 1s. For example:

      (1 1 0) (1 0 0) (0 1 1) (0 0 1) {answer} 0 1 1 0 1
1 1 1 0 0

Here are the reasons for the numbers in the result:

  1. 1 because 0 has the triplet 0 0 1 (invisible 0 on the left) which is found in the rule set
  2. 1 because 1 has the triplet 0 1 1 which is found in the rule set
  3. 1 because 1 has the triplet 1 1 0 which is found in the rule set
  4. 0 because 0 has the triplet 1 0 1 which is not found in the rule set
  5. 0 because 0 has the triplet 0 1 0 (invisible 0 on the right) which is not found in the rule set
      (1 0 0) (0 1 1) (0 1 0) (0 0 1) {answer} 0 1 0 0 1 0 1 0
1 1 1 1 1 0 1 1

      (1 1 0) (1 0 1) (0 1 1) (0 1 0) (0 0 1) {answer} 0 0 0 0 1
0 0 0 1 1

      (1 1 0) (1 0 1) (0 1 1) (0 1 0) (0 0 1) {answer} 0 0 0 1 1
0 0 1 1 1

      (1 1 0)(1 0 1)(0 1 1)(0 1 0)(0 0 1) {answer} 0 0 1 1 1
0 1 1 0 1

      (1 1 0)(1 0 1)(0 1 1)(0 1 0)(0 0 1) {answer} 0 1 1 0 1
1 1 1 1 1
Answer:Answer:

Your Answers

You must be logged in to view submitted solutions!