DEV Community

Discussion on: Introduction to functional programming with C#

simonsabin profile image
Simon Sabin

Your code has a huge flaw in that you aren't outputting what is being calculated. You are outputting the index of the item being multiplied, not the actual value being multiplied.

public static List<string> Format(List<int> list)
    => list.AsParallel()
    .Zip(list.AsParallel(), (result, item) => $"{item} x 2 = {result}")
Enter fullscreen mode Exit fullscreen mode