C# solution of leetcode