Fortinet interview question

programming problem