GroMo interview question

Dsa for Star pattern problem