Pregunta de entrevista de Merilytics

Given a star pattern, write code to print the same.