Amazon interview question

To print an array of numbers in their given pattern.