Appinventiv interview question

Java program to print pattern