Pergunta de entrevista da empresa Block

Random pair programming problems. Nothing difficult.