Pregunta de entrevista de Calsoft

coding problem in c# to implement