This is my code, I don't know what's wrong with it.

Appreciate any help.

```
public class Solution {
// you need treat n as an unsigned value
public int reverseBits(int n) {
int result = 0;
for (int i = 0; i < 32; i++) {
result = (result << 1) | (n & (1 << i));
}
return result;
}
}
```

This is the wrong answer for the test cases:

```
Input:
2 (00000000000000000000000000000010)
Output:
2147483648 (10000000000000000000000000000000)
Expected:
1073741824 (01000000000000000000000000000000)
```