c# solution and failed haskell solution

c# solution is less than efficient.