I'm assuming that the binary search method is faster. I still wanted to know if my solution is O(logN) or better or worse.

```
public class Solution {
public int singleNonDuplicate(int[] nums) {
int temp = 0;
for(int i = 0; i < nums.length; i++) {
if(i >= nums.length-1) {
temp = nums[nums.length-1];
break;
}
if(nums[i] == nums[i+1]) {
i++;
} else {
temp = nums[i];
break;
}
}
return temp;
}
}
```