#!/bin/bash
read -p "Enter the number of rows: " rows

for ((i = 1; i <= rows; i++)); do
    # Print leading spaces
    for ((j = i; j <= rows; j++)); do
        echo -n " "
    done
    # Print stars (2*i - 1 stars for row i)
    for ((k = 1; k <= 2 * i - 1; k++)); do
        echo -n "*"
    done
    echo "" # New line after each row
done
