Pergunta de entrevista da empresa Paintzen

3 JavaScript algorithm questions of various difficulty.