c# Puzzles, Algorithm, Data structures