I'm having a discussion with some other students from my program about what the O-complexity (regarding time) of this code would be:
public static void drawTriangle(int sizeOfTriangle) {
    for (int i = 0; i < sizeOfTriangle; i++) {
        for (int j = 0; j <= i; j++) {
            System.out.print("*");
        }
        System.out.println();
    }
}
They think it should be O(n^2) because of the nested for-loop and apparently that's also what the teaching assistant told them. However, I believe that it is O(n!) because the instruction System.out.print("*") is only ran exactly n! and not n^2 times. Can anybody please explain what the solution is and why? It would be very appreciated.
Edit: Sorry guys, I had a total brainfart where I thought n! = 1 + 2 + ... n and for some reason nobody pointed that out to me. I understand my mistake now ^^"
 
     
     
    