Pergunta de entrevista da empresa Citadel

Problem solving in hardware computation question.