Exact interview question

write a code that have output on below (Different Star output)