Diagonal Sort Javascript. We have given the n*n size matrix and we need to print the elements