Challenge 294 solutions in Perl by Matthias Muth
These are my .
Summary
Task 1: Consecutive Sequences
O(n)O(n) O(n)
solution using a small data structure and a lookup hash to keep track of 'streaks' (consecutive sequences) and to merge them with new numbers as they are processed.
Task 2: Next Permutation
Working 'locally' to flip numbers to get the next permutation, without the need to create all permutations first.
Code:
Find the complete source code for both tasks, including more tests, on .
SOCIAL SHARE CARD GENERATOR