Brandon Kiefer 181e7a58cd remove public access modifiers on ref solution for accumulate | 6 年之前 | |
---|---|---|
.. | ||
.meta/src/reference/java | 6 年之前 | |
src | 7 年之前 | |
README.md | 7 年之前 | |
build.gradle | 7 年之前 |
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:
And the operation:
x => x * x
)Your code should be able to produce the collection of squares:
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.
You can run all the tests for an exercise by entering
$ gradle test
in your terminal.
Conversation with James Edward Gray II https://twitter.com/jeg2
It's possible to submit an incomplete solution so you can see how others have completed the exercise.