From 8eae4313a92541e70b91f54f0c4d9bfd5829a4ef Mon Sep 17 00:00:00 2001 From: Divlo Date: Mon, 28 Jun 2021 20:04:14 +0200 Subject: [PATCH] feat(challenges): add `consecutive-numbers` --- challenges/consecutive-numbers/README.md | 29 +++++++++++++++++++ .../consecutive-numbers/solutions/.gitkeep | 0 .../consecutive-numbers/test/1/input.txt | 6 ++++ .../consecutive-numbers/test/1/output.txt | 2 ++ .../consecutive-numbers/test/2/input.txt | 0 .../consecutive-numbers/test/2/output.txt | 0 .../consecutive-numbers/test/3/input.txt | 4 +++ .../consecutive-numbers/test/3/output.txt | 0 .../consecutive-numbers/test/4/input.txt | 4 +++ .../consecutive-numbers/test/4/output.txt | 1 + .../consecutive-numbers/test/5/input.txt | 8 +++++ .../consecutive-numbers/test/5/output.txt | 3 ++ 12 files changed, 57 insertions(+) create mode 100644 challenges/consecutive-numbers/README.md create mode 100644 challenges/consecutive-numbers/solutions/.gitkeep create mode 100644 challenges/consecutive-numbers/test/1/input.txt create mode 100644 challenges/consecutive-numbers/test/1/output.txt create mode 100644 challenges/consecutive-numbers/test/2/input.txt create mode 100644 challenges/consecutive-numbers/test/2/output.txt create mode 100644 challenges/consecutive-numbers/test/3/input.txt create mode 100644 challenges/consecutive-numbers/test/3/output.txt create mode 100644 challenges/consecutive-numbers/test/4/input.txt create mode 100644 challenges/consecutive-numbers/test/4/output.txt create mode 100644 challenges/consecutive-numbers/test/5/input.txt create mode 100644 challenges/consecutive-numbers/test/5/output.txt diff --git a/challenges/consecutive-numbers/README.md b/challenges/consecutive-numbers/README.md new file mode 100644 index 0000000..feec4fb --- /dev/null +++ b/challenges/consecutive-numbers/README.md @@ -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. diff --git a/challenges/consecutive-numbers/solutions/.gitkeep b/challenges/consecutive-numbers/solutions/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/challenges/consecutive-numbers/test/1/input.txt b/challenges/consecutive-numbers/test/1/input.txt new file mode 100644 index 0000000..8261527 --- /dev/null +++ b/challenges/consecutive-numbers/test/1/input.txt @@ -0,0 +1,6 @@ +7 +1 +2 +5 +3 +4 \ No newline at end of file diff --git a/challenges/consecutive-numbers/test/1/output.txt b/challenges/consecutive-numbers/test/1/output.txt new file mode 100644 index 0000000..dc56a27 --- /dev/null +++ b/challenges/consecutive-numbers/test/1/output.txt @@ -0,0 +1,2 @@ +1 ; 2 +3 ; 4 \ No newline at end of file diff --git a/challenges/consecutive-numbers/test/2/input.txt b/challenges/consecutive-numbers/test/2/input.txt new file mode 100644 index 0000000..e69de29 diff --git a/challenges/consecutive-numbers/test/2/output.txt b/challenges/consecutive-numbers/test/2/output.txt new file mode 100644 index 0000000..e69de29 diff --git a/challenges/consecutive-numbers/test/3/input.txt b/challenges/consecutive-numbers/test/3/input.txt new file mode 100644 index 0000000..dfa147a --- /dev/null +++ b/challenges/consecutive-numbers/test/3/input.txt @@ -0,0 +1,4 @@ +1 +4 +3 +5 \ No newline at end of file diff --git a/challenges/consecutive-numbers/test/3/output.txt b/challenges/consecutive-numbers/test/3/output.txt new file mode 100644 index 0000000..e69de29 diff --git a/challenges/consecutive-numbers/test/4/input.txt b/challenges/consecutive-numbers/test/4/input.txt new file mode 100644 index 0000000..eb6b3c1 --- /dev/null +++ b/challenges/consecutive-numbers/test/4/input.txt @@ -0,0 +1,4 @@ +1 +4 +5 +3 \ No newline at end of file diff --git a/challenges/consecutive-numbers/test/4/output.txt b/challenges/consecutive-numbers/test/4/output.txt new file mode 100644 index 0000000..56335ba --- /dev/null +++ b/challenges/consecutive-numbers/test/4/output.txt @@ -0,0 +1 @@ +4 ; 5 \ No newline at end of file diff --git a/challenges/consecutive-numbers/test/5/input.txt b/challenges/consecutive-numbers/test/5/input.txt new file mode 100644 index 0000000..0e9ff98 --- /dev/null +++ b/challenges/consecutive-numbers/test/5/input.txt @@ -0,0 +1,8 @@ +5 +1 +2 +3 +8 +-5 +-4 +7 \ No newline at end of file diff --git a/challenges/consecutive-numbers/test/5/output.txt b/challenges/consecutive-numbers/test/5/output.txt new file mode 100644 index 0000000..57b4b8e --- /dev/null +++ b/challenges/consecutive-numbers/test/5/output.txt @@ -0,0 +1,3 @@ +1 ; 2 +2 ; 3 +-5 ; -4 \ No newline at end of file