Help Rahul To Search

What error in this code only one test case pass what should i do

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] arr = new int[N];

	       for(int i=0;i<arr.length;i++) {
	    	   arr[i]=sc.nextInt();
	    	   
	       }
	       int item  =sc.nextInt();

	     System.out.println(helpRahulToSearch(arr,item));
	    }
			private static int  helpRahulToSearch(int[] arr, int item) {
				int lo=0;
				int hi=arr.length-1;
				while(lo<=hi){
					int mid = (lo+hi)/2;
					if(arr[mid]<item){
						lo = mid+1;
					}else if(arr[mid]>item){
						hi = mid-1;
					}else{
						return mid;
					}
				}
	return -1;
			}

}

debug for this:
5
3
4
5
1
2
2
Correct output:
4
you can watch this too
https://www.youtube.com/watch?v=QOVBnzPgFYY