Why it didn't pass all the test cases? Whats Wrong in it?
Check your code with this input:
5
1 2 3 5 6
1
4
Expected O/p:
-1 -1
If that query is not in that array, you are suppose to print -1.
Check your code with this input:
5
1 2 3 5 6
1
4
Expected O/p:
-1 -1
If that query is not in that array, you are suppose to print -1.