feat(challenges): add consecutive-numbers

This commit is contained in:
Divlo committed 2021-06-28 20:04:14 +02:00
1 parent a630f6f7fb
commit 8eae4313a9
12 files changed
+57

No files matched your search

+29
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.
Whitespace-only changes.
@@ -0,0 +1,6 @@
7
1
2
5
3
4
@@ -0,0 +1,2 @@
1 ; 2
3 ; 4
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,4 @@
1
4
3
5
Whitespace-only changes.
@@ -0,0 +1,4 @@
1
4
5
3
@@ -0,0 +1 @@
4 ; 5
@@ -0,0 +1,8 @@
5
1
2
3
8
-5
-4
7
@@ -0,0 +1,3 @@
1 ; 2
2 ; 3
-5 ; -4