1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-07-18 02:20:12 +02:00
programming-challenges/challenges/consecutive-numbers
2023-08-10 11:13:06 +02:00
..
solutions fix(solutions): memory issues thanks to -fsanitize=address flag with gcc 2023-08-10 11:13:06 +02:00
test fix(challenges): update consecutive-numbers 2021-06-29 17:35:54 +02:00
README.md fix: update author - Théo LUDWIG 2023-07-02 17:28:54 +02:00

consecutive-numbers

Created by @theoludwig on 28 June 2021.

Instructions

Write a function which takes a list of integers, and which returns the list of of successive consecutive integers that there may be in the list.

First input, is the number of consecutive numbers needed to consider it as "consecutive", the second input is the list of integers.

Examples

See the test folder for examples of input/output.

Example 1

Input

2
5 ; 1 ; 2 ; 3 ; 8 ; -5 ; -4 ; 7

Output

1 ; 2
2 ; 3
-5 ; -4

Example 2

Input

3
5 ; 1 ; 2 ; 3 ; 8 ; -5 ; -4 ; 7

Output

1 ; 2 ; 3