What happens if I forget the bottom row boundary?
The bottom row will print exactly like the middle rows a single star on the left, empty space, and a single star on the right leaving the bottom of the pyramid open.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Advanced Hollow Patterns (Hollow Pyramid)
First, use an inner loop to print the required leading spaces to align the shape. Then, use a second inner loop with if-else boundary checks to draw the hollow interior.
Inside the star loop, the boundaries are the first column (col == 1), the last column (col == 2*row - 1), and the final row (row == N).
Because once the leading spaces have aligned the shape, the hollow center of the pyramid must be filled with blank spaces to push the right-side stars to their correct positions.
Still have questions?
Browse all our FAQs or reach out to our support team
