Blue Flame Labs interview question

Write a code for star pattern.