Pergunta de entrevista da empresa Vir Softech

Same rectangle question and also deadlock