Mirror Triangle Pattern

Easy
pattern loops string-formatting
Problem Description

Print a mirrored numeric triangle pattern where each row contains numbers from the row number down to 1. For input N, create N rows where row i contains numbers from i down to 1.

Input Format
A single integer N representing the number of rows.
Output Format
N lines, each containing the pattern for that row (no trailing spaces).
Constraints
• 1 ≤ N ≤ 20
• Each row i contains numbers from i down to 1
• Numbers are printed without spaces between them
• No trailing spaces or newlines
Sample Input/Output
Input:
4
Output:
1
21
321
4321
Explanation

Row 1: "1", Row 2: "21", Row 3: "321", Row 4: "4321". Each row starts with the row number and counts down to 1.

Solution Hints
50
Points
1000ms
Time Limit
64MB
Memory Limit
Code Editor
Register to Submit
Register to Access Code Editor

Create a free account to solve coding problems and track your progress.

Register Now
Feedback