Worldline interview question

Write the code for Star pattern(reversed)