Hello, welcome to the fifth BigO notation challenge where we will be solving a few challenges.
Goodmorning again welcome to #mondayexpress, today we will be heading over to our exercisim team where each week I share new challenges to fix.
Here is today's challenge
Implement the accumulate operation, which, given a collection and an operation to perform on each element of the collection, returns a new collection containing the result of applying that operation to each element of the input collection.
Given the collection of numbers:
1, 2, 3, 4, 5
And the operation:
square a number (x => x * x)
Your code should be able to produce the collection of squares:
1, 4, 9, 16, 25
Check out the test suite to see the expected function signature.
Keep your hands off that collect/map/fmap/whatchamacallit functionality provided by your standard library! Solve this one yourself using other basic tools instead.
Please cd into exercise directory before running all below commands.
Install assignment dependencies:
$ npm install
Making the test suite pass
Execute the tests with:
$ npm test
In the test suites all tests but the first have been skipped.
Once you get a test passing, you can enable the next one by changing xtest to test.
Once you have a solution ready, you can submit it using:
exercism submit accumulate.js
Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
To Join click on the link here Monday Express. If you need more languages covered you can always reach out
Let's Join and solve these challenges.
Top comments (0)