Pregunta de entrevista de Arista Networks

Basic algorithm question in C.