All Problems

Problem title

Difficulty

Avg time to solve

Find Longest Sequence

Moderate

15 mins

Diamond of numbers

Moderate

15 mins

Galaxy of stars

Easy

15 mins

Arrow Pattern

Easy

10 mins

Row Wave Form

Easy

15 mins

Median of a BST in O(1) space

Easy

10 mins

Minimize the maximum difference between adjacent elements in an array

Easy

15 mins

Check If Two Expressions With Brackets Are Same

Easy

16 mins

Total Number of BSTs using array elements as root node

Moderate

15 mins

Binary strings with no consecutive 1s.

Moderate

25 mins

Problem

Submissions

4

Avg. time to solve

15 min

Success Rate

80%

Problem Statement

```
The pattern for ‘N’ = 7 will look like this:
*
**
***
****
***
**
*
```

```
The first line contains an integer 'T' which denotes the number of test cases or queries to be run.
The first line of each test case contains one integer, ‘N’, denoting the number of rows.
```

```
For each test case, print 'N' strings denoting the pattern.
The output of each test case will be printed on a separate line.
```

```
You do not need to input or print anything, as it has already been taken care of. Just implement the given function.
```

```
1 <= T <= 5
1 <= N <= 99
Time Limit: 1 sec
```

```
2
3
5
```

```
*
**
*
*
**
***
**
*
```

```
Test case 1:
In the first test case of sample input 1, we need to print a triangle-like pattern wherein each line, the number of stars will be increasing till the central row and then it starts decreasing. So for n=3, till 2nd-row stars increase and then start decreasing.
```

```
1
1
```

```
*
```

```
Test case 1:
As ‘N’ is equal to ‘1’, we just need to print one line.
```

Java (SE 1.8)

Console

Sample Test Case

Custom Test Case

Download Test Cases

Test Case 1

Test Case 2

Test Case 3

Saving Code...

Full Screen Mode

Change Theme

Solution submission not allowed

Save Code

Reset Code