Pergunta de entrevista da empresa Interland

pattern-printing program and explain my logic