Domanda di colloquio di Western Digital

coding question on logic about numbering