This is a question from codingbat
Given an integer n greater than or equal to 0,
create and return an array with the following pattern:
    squareUp(3) => [0, 0, 1, 0, 2, 1, 3, 2, 1]
    squareUp(2) => [0, 1, 2, 1]
    squareUp(4) => [0, 0, 0, 1, 0, 0, 2, 1, 0, 3, 2, 1, 4, 3, 2, 1]
n<=1000.
# Check out my other kata!
Matrix Diagonal Sort OMG
String -> N iterations -> String
String -> X iterations -> String
ANTISTRING
Array - squareUp b!
Matrix - squareUp b!
Infinitely Nested Radical Expressions
pipi Numbers!
def square_up(n):
    sqrList = [0 for _ in range(n*n)]

    #we build the square list, from right to left, in sets
    # e.g. for n==5  [5i-1,  5i-2,  5i-3,  5i-4, 5i-5]  for i = 1,2,...,n
    for i in range(1,n+1):          #iterate over the  1,2,...,n sets
        index = n*i - 1             #Start the index in the right most index of the set n
        for j in range(1, i+1):     #pattern: 1, 1;2, 1;2;3, 1;2;3;4, ..., 1;2;3;;;n 
            sqrList[index] = j
            index -=1

    return sqrList
#-----end function

def square_up(n):
    sqrList = [0 for _ in range(n*n)]

    #we build the square list, from right to left, in sets
    # e.g. for n==5  [5i-1,  5i-2,  5i-3,  5i-4, 5i-5]  for i = 1,2,...,n
    for i in range(1,n+1):          #iterate over the  1,2,...,n sets
        index = n*i - 1             #Start the index in the right most index of the set n
        for j in range(1, i+1):     #pattern: 1, 1;2, 1;2;3, 1;2;3;4, ..., 1;2;3;;;n 
            sqrList[index] = j
            index -=1

    return sqrList
#-----end function
