1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01:00

feat(challenges): add consecutive-numbers

This commit is contained in:
Divlo 2021-06-28 20:04:14 +02:00
parent a630f6f7fb
commit 8eae4313a9
No known key found for this signature in database
GPG Key ID: 185ED2F15F104E52
12 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,29 @@
# consecutive-numbers
Created by [@Divlo](https://github.com/Divlo) on 28 June 2021.
## Instructions
Write a function which takes a list of integers, and which returns the (possibly empty) list of pairs of successive consecutive integers that there may be in the list.
### Input
```txt
7
1
2
5
3
4
```
### Output
```txt
1, 2
3, 4
```
## Examples
See the `test` folder for examples of input/output.

View File

@ -0,0 +1,6 @@
7
1
2
5
3
4

View File

@ -0,0 +1,2 @@
1 ; 2
3 ; 4

View File

@ -0,0 +1,4 @@
1
4
3
5

View File

@ -0,0 +1,4 @@
1
4
5
3

View File

@ -0,0 +1 @@
4 ; 5

View File

@ -0,0 +1,8 @@
5
1
2
3
8
-5
-4
7

View File

@ -0,0 +1,3 @@
1 ; 2
2 ; 3
-5 ; -4