Pergunta de entrevista da empresa MathWorks

Algorithm for connecting squares in a grid