```
public class Solution {
public int singleNumber(int[] A) {
int len = A.length;
if(len==1){
return A[0];
}
for(int i=0;i<len;i++){
for(int j=len-1;j>i;j--){
if(A[i]!=Integer.MAX_VALUE && A[i]==A[j]){
A[i] = Integer.MAX_VALUE;
A[j] = Integer.MAX_VALUE;
break;
}
else if(A[i]!=Integer.MAX_VALUE && j==i+1){
return A[i];
}
}
if(i==len-1){
return A[i];
}
}
return 0;
}
```

}

My code got TLE before I using len to store the value of A.length, but accepted after I did that. Is my code in linear time?

Thanks