You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.
I can't think of any scenario where I would solve the Collections Fold task using fold efficiently. I think it should be changed to showcase a realistic scenario for fold. This task could be reused as an example for reduce though. Here is a solution I think is good for this task.
Also, the function name in N22Fold.kt is getSetOfProductsOrderedByEachCustomer which is confusing to the actual test testGetProductsOrderedByAllCustomers.
I inferred code to get all products ordered and test to get common product ordered by all customers.
I can't think of any scenario where I would solve the Collections Fold task using
fold
efficiently. I think it should be changed to showcase a realistic scenario forfold
. This task could be reused as an example forreduce
though. Here is a solution I think is good for this task.Or an even more optimized solution:
The text was updated successfully, but these errors were encountered: