```
public class Solution {
public int findPeakElement(int[] num) {
if(num == null)
return 0;
int len = num.length;
if(len == 0)
return 0;
int i = 0;
while(++i < len){
if(num[i] < num[i - 1])
return (i - 1);
}
return (len - 1);
}
}
```

just find the element which is less than its previous one.