Fighting with the longest common prefix puzzle - C#