if(arr[i]==k) return arr[i]; code example Example: if(arr[i]==k) return arr[i]; if(arr[i]==k){ return arr[i]; }