Login

All Problems

Problem title

Difficulty

Avg time to solve

Unique Matrix

Moderate

15 mins

Diameter Of Binary Tree

Easy

10 mins

Triplets in Binary Tree

Easy

15 mins

Subarrays With Zero Sum

Easy

--

Convert Bst To The Greater Sum Tree

Moderate

30 mins

Positive Negative Pair

Easy

10 mins

Implement a priority queue

Moderate

--

LCA Of Binary Tree

Moderate

10 mins

Frequency In A Sorted Array

Easy

15 mins

Maximum activities

Easy

15 mins

Problem

Submissions

5

Problem Statement

```
Let ‘ARR’ be: [1, 4, -5]
The subarray [1, 4, -5] has a sum equal to 0. So the count is 1.
```

```
The first line of input contains an integer ‘T’, denoting the number of test cases.
The first line of each test case contains an integer, ‘N’, representing the size of the array.
The second line of each test case contains ‘N’ space-separated integers, representing the array ‘ARR’ elements.
```

```
For each test case, print the sorted array.
Print output of each test case in a separate line.
```

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

```
1 <= T <= 10
1 <= N <= 10^5
-10^5 <= ARR[i] <= 10^5
Time Limit: 1 sec
```

```
2
3
1 4 -5
4
-1 1 0 1
```

```
1
3
```

```
For test case 1:
The subarray [1, 4, -5] has a sum equal to 0.
So the count is 1.
For test case 2:
The subarray [-1, 1], [-1, 1, 0] and [0] has a sum equal to 0.
So the count is 3.
```

```
2
4
-1 0 1 -1
3
-2 0 2
```

```
4
2
```

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