Doubt doubt doubt

wat’s wrong with my code?

@priyamthakuria27 wrong when element not present
5
1 4 5 6 9
2
2
7
giving incorrect for this ans should be
-1 -1
-1 -1

check my code again?
i changed something. still doesn’t work

@priyamthakuria27 share your updated code here through ide link

@priyamthakuria27 its correct , it passes all the testcases