This site automatically validates APL solutions for practice problems sourced from The APL Problem Solving Competition.

Each problem starts with a task description; some also include a hint suggesting one or more APL primitives. These may be helpful in solving the problem, but you are under no obligation to use them. Clicking on a primitive in the hint opens the Dyalog documentation page for that primitive.

Each problem ends with some example cases. You can use these as a basis for implementing your solution.

i
**Note:**
The validation system uses Dyalog version 17.1 so your solutions must work on this version of Dyalog APL.

Notice something wrong? Report a bug

Have an idea for a feature? Submit a feature request

Have an idea for a new practice problem? Suggest a new Practice Problem

Write an APL function to count the number of vowels (A, E, I, O, U) in an array consisting of uppercase letters (AāZ).

š” Hint: The membership function `XāY`

could be helpful for this problem.

Examples

```
(your_function) 'COOLAPL'
3
(your_function) '' ā empty argument
0
(your_function) 'NVWLSHR' ā no vowels here
0
```

Below are three sample solutions. All three produce the correct answer, but the first twofunctions would be ranked higher by the competition judging committee. This is becausethe first two demonstrate better use of array-oriented programming.

```
({+/āµā'AEIOU'}) 'COOLAPL' ā good dfn
3
(+/āā'AEIOU') 'COOLAPL' ā good tacit function
3
{(+/āµ='A')+(+/āµ='E')+(+/āµ='I')+(+/āµ='O')+(+/āµ='U')} 'COOLAPL' ā suboptimal dfn
3
```

If you put each of the above three functions into the input field below and click Submit, youāll see that they only pass the basic test cases. This is because none of those functions handle arrays with 2 or more dimensions. The system will also give you an example of a multi-dimensional edge case that failed, so that you can attempt to improve your solution.

Try entering `{+/,āµā'AEIOU'}`

which handles all test cases.

your_function ā