C# version of the Week 6 assignment of the Coursera "Functional Programming Principles in Scala" course