- without STL
https://ide.codingblocks.com/s/425644 - with STL
https://ide.codingblocks.com/s/425647
I am not passing test cases please help me i do this question without using STL and using STL please tell my mistake in both code
Hello @anshulgurawalia this is your correct of using with STL:
https://ide.codingblocks.com/s/425654
check the constraints for the array size.
and you to endl even after printing -1.
you have to check whether the element is even present or not in the list.
i am checking your code for the without STL as well.
in your without STL code as well you have to just change the array size from 100 to 100000.
and this will work.
why you don’t use find function to search the array
if i use find function such that : if(find(arr,arr+n,query) - arr >=n(total no of element ) ) then print -1 and -1;
here is the code:-
@anshulgurawalia you can use find function as well.
you can try it will also work.
the main error was printing mistake and the array size.
please correct my this code i don’t know why this code is not passing test cases with STL :-
https://ide.codingblocks.com/s/425768
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.