Creating an array length n * n, separating it into n groups, and adding numbers to it n times
Addressing into a 1d or 2d array is not a real problem for a square array

ary[i,j] = value;


can be written as 

ary[i*n + j] = value


where n is the dimension.

The following passes the tests on CodingBat though there may be more elegant ways to approach it

public int[] squareUp(int n) {
    int[] result = new int[n*n]; 
    int zeroCount = n-1;
    for(int outer = 0; outer &lt;n; outer++){
        for(int inner = 0; inner &lt; n; inner++){
            result[(outer * n) + inner] = zeroCount &gt; inner
                                            ? 0
                                            : (n-inner);
        }
        zeroCount--;
    }
    return result;
}