Animate the Inverted Triangle star pattern and see how changing the inner loop bound flips the shape.
An upside-down right triangle. Row 0 starts with n stars and each subsequent row has one fewer star.
Outer loop i goes 0 to n-1. Inner loop j goes from 0 to n-i-1. Stars per row = n - i.
It is the mirror of the right triangle. Swap the start and end of the outer loop or change the inner loop bound to n-i.