【leetcode】搜索插入位置

 

int searchInsert(int* nums, int numsSize, int target){
    for (int i=0; i<numsSize; i++) if (nums[i] >= target) return i;
    return numsSize;
}

 

posted @ 2020-09-07 09:53  温暖了寂寞  阅读(116)  评论(0)    收藏  举报