Amazon Interview Question

To print an array of numbers in their given pattern.