Pergunta de entrevista da empresa Walmart

Design an algorithm that traverses through the 4 points of a rectangle