⏱ 00:00
Attempts:0
Best: 0/100
Basic Loops & StarsTarget Time: 8 mins
Right Triangle Star Pattern
Given an integer N, print a right-angled triangle star pattern of N rows where row i contains exactly i stars (*).
Input Format
A single integer N denoting the number of rows.
Output Format
Print the pattern with N rows. Each row contains stars without leading spaces.
Constraints:1 <= N <= 20
Concepts Required:
Single loop iterationNested for loopsConsole output / String concatenation
Expected Pattern PreviewASCII Monospace
* ** *** **** *****
Notice how character spacing and row counts scale systematically based on the input N.
Concrete Examples
Example 1
Input:
5
Output:
* ** *** **** *****
Explanation: For N = 5, row 1 has 1 star, row 2 has 2 stars, ..., row 5 has 5 stars.
Example 2
Input:
3
Output:
* ** ***
Explanation: For N = 3, there are 3 rows with 1, 2, and 3 stars respectively.
