Geeksforgeeks

Error

Given an integer **N**, print an inverted isosceles triangle of stars such that the height of the triangle is **N**.

**Example 1:**

Input:N =4Output:******* ***** *** *

**Example 2:**

Input:N =3Output:***** *** *

**Your Task:**

You don't need to read input or print anything. Your task is to complete the function **invIsoTriangle()** which takes an Integer N as input and returns a vector of strings where each line represents lines of the pattern. For example, if N=2, the vector v = {"***", " * "}.

**Expected Time Complexity:** O(N)

**Expected Auxiliary Space:** O(N)

**Constraints:**

1 <= N <= 100

We are replacing the old Disqus forum with the new Discussions section given below.

Click here to view old Disqus comments.

Click here to view old Disqus comments.

Login to report an issue on this page.

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

YesLoading...

Inverted triangle of stars

...