Course of Raku / Advanced / Containers / Ordered containers / Exercises

Flatten the parts

Problem

You are given two arrays:

my @first = 1, 2;
my @second = 3, 4, 5;

Combine them into a single flat array (not a nested one). Print the array and then the number of its elements.

Example

The program prints:

[1 2 3 4 5]
5

Solution

See the solution

Course navigation

Solution: Alias an array   |   Solution: Flatten the parts