I am not able to find the mistake

Acc to me the solution is correct…but on submission all cases r wrong…please give me some test cases for which it is giving wring answer…I tried on some…and the answers were correct for them

https://ide.geeksforgeeks.org/tDlRZL8nx7

This is my code URL

@kaushikjatin
input
6
4

2 5 8 10

6 4 1 2

3

5 3 10

6 4 1

6

1 2 3 4 5 6

3 4 5 6 1 2
4
0 2 1 1
1 4 4 3
3
0 1 1
1 2 -1
3
0 1 1
1 3 2
output
2
2
4
4
2
3

thnx @aa1… …

@kaushikjatin
mark your doubt as resolved and rate as well

I think I did already after your 1st reply…

1 Like