not sure why this works, but I think the commented line should be included

```
public:
int integerReplacement(int n) {
if(n==0)return 0;
int res = 0;
if(n==INT_MAX){
n--;
// res=1;
}
if(n==INT_MIN){
n++;
//res=1;
}
while(n!=1){
if(n==3) return res+2;
if(n%2==0)
n=n/2;
else{//odd
if(n%4==3){n++;}
else n--;
}
res++;
}
return res;
}
};```
```