Pregunta de entrevista de Mphasis

Have been asked to write a code for * pattern