Pergunta de entrevista da empresa Sandia National Laboratories

How would you solve this problem in parallel?