Pregunta de entrevista de Microsoft

Coding assesment and Problem solving logic question