public class Solution { public int findMin(int[] nums) { int len=nums.length; for(int i=0;i<len;i++) { if(i-1>=0) { if(nums[i]<nums[i-1]) return nums[i]; } } return nums[0]; } }