leetcode-剑指11-OK

同主站154题
address

int minArray(int* numbers, int numbersSize){
    if(numbersSize == 1)
        return numbers[0];
    int i = 0;
    while((i<numbersSize-1) && (numbers[i] <=numbers[i+1])){
        i++;
    }
    if(i == numbersSize-1)
        return numbers[0];
    return numbers[i+1];
}
posted @ 2021-01-21 20:20  RougeBW  阅读(31)  评论(0编辑  收藏  举报