Solved problem 2

C# console solution for problem 2