Perl Weekly Challenge 182: Unique Array and Date Difference
These are some answers to the Week 183 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Task 1: Unique Array
You are given list of arrayrefs.
Write a script to remove the duplicate arrayrefs from the given list.
Example 1
Input: @list = ([1,2], [3,4], [5,6], [1,2])
Output: ([1,2], [3,4], [5,6])
Example 2
Input: @list = ([9,1], [3,7], [2,5], [2,5])
Output: ([9, 1], [3,7], [2,5])
Unique Array in Raku
The Raku solution is essentially a one-liner (more than one line because of the tests). We convert the sub-arrays into strings and use the unique built-in routine to remove duplicates.