logoStarPatterns
Back to Patterns

Reverse Left Half Pyramid

Pattern Result

*****
****
***
**
*

Code Implementation

Explanation

The Reverse Left Half Pyramid pattern creates an inverted triangle shape that is aligned to the left side. Each row consists of stars, with the number of stars decreasing as the row number increases. The outer loop iterates from n down to 1, representing each row. For each row, we add i stars to create the inverted pyramid shape. This pattern is the inverse of the Left Half Pyramid pattern.