Pergunta de entrevista da empresa Fortinet

Several alogorithm problems, medium difficulty.