Login

All Problems

Problem title

Difficulty

Avg time to solve

Insert Into A Binary Search Tree

Easy

20 mins

Ninja’s Training

Moderate

30 mins

Path With Maximum And Minimum Value

Easy

15 mins

BST Iterator

Moderate

20 mins

Morty and his array

Hard

--

Minimum Cost To Buy Oranges

Moderate

20 mins

Element that appears once

Easy

15 mins

Delete a Given Node

Easy

15 mins

Palindrome Partitioning ll

Moderate

40 mins

Total Number Of Spanning Trees In A Graph

Hard

15 mins

Problem

Submissions

7

Avg. time to solve

30 min

Success Rate

50%

Problem Statement

```
If the given ‘POINTS’ array is [[1,2,5], [3 ,1 ,1] ,[3,3,3] ],the answer will be 11 as 5 + 3 + 3.
```

```
The first line of the input contains an integer, 'T,’ denoting the number of test cases.
The first line of each test case contains a single integer,' N’, denoting the number of days.
The next ‘N’ lines of each test case have 3 integers corresponding to POINTS[i].
```

```
For each test case, return an integer corresponding to the maximum coins Ninja can collect.
```

```
You do not need to print anything. It has already been taken care of. Just implement the given function.
```

```
1 <= T <= 10
1 <= N <= 100000.
1 <= values of POINTS arrays <= 100 .
Time limit: 1 sec
```

```
2
3
1 2 5
3 1 1
3 3 3
3
10 40 70
20 50 80
30 60 90
```

```
11
210
```

```
For the first test case,
One of the answers can be:
On the first day, Ninja will learn new moves and earn 5 merit points.
On the second day, Ninja will do running and earn 3 merit points.
On the third day, Ninja will do fighting and earn 3 merit points.
The total merit point is 11 which is the maximum.
Hence, the answer is 11.
For the second test case:
One of the answers can be:
On the first day, Ninja will learn new moves and earn 70 merit points.
On the second day, Ninja will do fighting and earn 50 merit points.
On the third day, Ninja will learn new moves and earn 90 merit points.
The total merit point is 210 which is the maximum.
Hence, the answer is 210.
```

```
2
3
18 11 19
4 13 7
1 8 13
2
10 50 1
5 100 11
```

```
45
110
```

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 Language

Change Theme

Solution submission not allowed

Save Code

Reset Code