# Showing error even if the solution is correct. Array Q 22.

20
Views

2
Comments

Sunag
2 weeks ago

I am getting error even though the solution is correct. Code is provided below.

```
n = int(input()) # no of array
def sort_array(n):
for i in range(0, n):
a = int(input())
a_list = list(map(int, input().split()))
a_list.sort()
print(*a_list,end=' ')
sort_array(n)
```

Input:

```
3
2
98 12
6
1 2 3 8 5 9
1
11
```

Output:

`12 98 1 2 3 5 8 9 11`

I am getting correct output even for test cases. Need to know what is the problem.

Regards,

Sunag R A.