Series in Erlang
Given a string of digits, output all the contiguous substrings of length `n` in that string.
exercism fetch erlang series
Given a string of digits, output all the contiguous substrings of length
For example, the string "49142" has the following 3-digit series:
And the following 4-digit series:
And if you ask for a 6-digit series from a 5-digit string, you deserve whatever you get.
Note that these series are only required to occupy adjacent positions in the input; the digits need not be numerically consecutive.
In order to run the tests, issue the following command from the exercise directory:
For running the tests provided,
rebar3 is used as it is the official build and
dependency management tool for erlang now. Please refer to the tracks installation
instructions on how to do that.
In order to run the tests, you can issue the following command from the exercise directory.
$ rebar3 eunit
Each problem defines a macro
TEST_VERSION in the test file and
verifies that the solution defines and exports a function
returning that same value.
To make tests pass, add the following to your solution:
The benefit of this is that reviewers can see against which test version an iteration was written if, for example, a previously posted solution does not solve the current problem or passes current tests.
For detailed information about the Erlang track, please refer to the help page on the Exercism site. This covers the basic information on setting up the development environment expected by the exercises.
A subset of the Problem 8 at Project Euler http://projecteuler.net/problem=8
Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.