All Problems

Problem title

Difficulty

Avg time to solve

Number Pattern

Easy

15 mins

Find rank

Easy

15 mins

Maximum 1s

Easy

10 mins

Maximum Sum Of (i * ARR[i]) Among All Possible Rotations Of An Array

Moderate

15 mins

Star Pattern

Easy

10 mins

Number Pattern

Easy

15 mins

Game of Numbers

Easy

20 mins

Find Character Case

Easy

9 mins

Power of Two

Easy

15 mins

Count Leaf Nodes

Easy

10 mins

Problem

Submissions

7

Avg. time to solve

15 min

Success Rate

85%

Problem Statement

```
Example For ‘N’ = 4
Pattern:
4444
3444
2344
1234
```

```
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 <= 200
Time Limit: 1 sec
```

```
2
5
2
```

```
55555
45555
34555
23455
12345
22
12
```

```
Test case 1:
In the first test case, as ‘N’ is equal to ‘5’, We will have to print five lines. We have a print a square-like pattern where the upper right triangle along with the main diagonal will be filled with the input number and the lower-left triangle will be a triangle wherein each row, number of elements increases from ‘1’ to ‘N’ - 1;
Test case 2:
In the second test case, as ‘N’ is equal to ‘2’, We will have to print two lines.
```

```
2
1
4
```

```
1
4444
3444
2344
1234
```

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

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