Pergunta de entrevista da empresa Jet

Simple algorithms, a bit of functional programming concepts.