DiagonalPrint.java

Given an array of numbers print the values in diagonal format.

Example (1) for 8 dataset
Input Array : [1, 2, 3,4,5,6,7,8]
Output
01 02 04 07
03 05 08
06

Example (2) for 45 dataset
Input Array: [1, 2, 3,4,5,6,7,8,9,10……….44, 45]
Output
01 02 04 07 11 15 19 23 27 31 35 39
03 05 08 12 16 20 24 28 32 36 40 43
06 09 13 17 21 25 29 33 37 41 44
10 14 18 22 26 30 34 38 42 45

Code in Java.
source: http://www.careercup.com/question?id=5673265078992896