Solved Problems on both C# and C++