Found at last123

https://ide.codingblocks.com/s/51628
not working for one test case

Hey Aastha, your code is not working when there is only one element in the array. for eg. check for this case
input:
1
5
5

your code’s output is : -1
but the expected output is : 0

i have changed my code according to the test case where input is only one number now it’s not working for other test case

https://ide.codingblocks.com/s/51628his is the link to the code

Hey Aastha, you can use binary search only when the array is sorted, but in the problem array coming in the input is not sorted so you can’t use binary search in this problem.