I'm happy that my O(n) solution is accepted. I know a better solution is using binary search.

Here is my code in Java. Its' quite clean and clear. I'm just wondering what's the rule of OJ's judgement system.

public class Solution {

public int findMin(int[] num) {

```
int result = num[0];
for(int i = 1; i < num.length; i++)
{
if( num[i] < num[i-1])
result = num[i];
}
return result;
// the above linear time solution is acceptable.
// a better solution is using binary search.
}
```

}