Perl Weekly Challenge 131: Consecutive Arrays
These are some answers to task 1 of the Week 131 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on September 26, 2021 at 24:00). This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
You are given a sorted list of unique positive integers.
Write a script to return list of arrays where the arrays are consecutive integers.
Example 1:
Input: (1, 2, 3, 6, 7, 8, 9)
Output: ([1, 2, 3], [6, 7, 8, 9])
Example 2:
Input: (11, 12, 14, 17, 18, 19)
Output: ([11, 12], [14], [17, 18, 19])
Example 3:
Input: (2, 4, 6, 8)
Output: ([2], [4], [6], [8])
Example 4:



