2021-06-28 20:04:14 +02:00
|
|
|
# consecutive-numbers
|
|
|
|
|
2023-07-02 17:28:54 +02:00
|
|
|
Created by [@theoludwig](https://github.com/theoludwig) on 28 June 2021.
|
2021-06-28 20:04:14 +02:00
|
|
|
|
|
|
|
## Instructions
|
|
|
|
|
2021-06-29 17:35:54 +02:00
|
|
|
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.
|
2021-06-28 20:04:14 +02:00
|
|
|
|
2021-06-29 17:35:54 +02:00
|
|
|
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
|
2021-06-28 20:04:14 +02:00
|
|
|
|
|
|
|
```txt
|
|
|
|
2
|
2021-06-29 17:35:54 +02:00
|
|
|
5 ; 1 ; 2 ; 3 ; 8 ; -5 ; -4 ; 7
|
2021-06-28 20:04:14 +02:00
|
|
|
```
|
|
|
|
|
2021-06-29 17:35:54 +02:00
|
|
|
#### Output
|
2021-06-28 20:04:14 +02:00
|
|
|
|
|
|
|
```txt
|
2021-06-29 17:35:54 +02:00
|
|
|
1 ; 2
|
|
|
|
2 ; 3
|
|
|
|
-5 ; -4
|
2021-06-28 20:04:14 +02:00
|
|
|
```
|
|
|
|
|
2021-06-29 17:35:54 +02:00
|
|
|
### Example 2
|
2021-06-28 20:04:14 +02:00
|
|
|
|
2021-06-29 17:35:54 +02:00
|
|
|
#### Input
|
|
|
|
|
|
|
|
```txt
|
|
|
|
3
|
|
|
|
5 ; 1 ; 2 ; 3 ; 8 ; -5 ; -4 ; 7
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Output
|
|
|
|
|
|
|
|
```txt
|
|
|
|
1 ; 2 ; 3
|
|
|
|
```
|