Where is the problem?


  • 0
    K

    `class Solution {

    public:

    int findMin(vector<int> &num) {
    
        vector<int>::iterator b,e;
    
        b = num.begin();
    
        e = num.end();
    
        int tmp = *b;
    
        if(num.size() == 1){
    
            return *b;
    
        }
    
        if(*b < *e){
    
            return *b;
    
        }else{
    
            while(b < e && tmp <= *++b){
    
                tmp = *b;
    
            }
    
            return *b;
    
        }
    
    }
    

    };`


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.