Leetcode 练习 35.找到插入位置

https://leetcode.com/problems/search-insert-position/

【Leetcode 练习 35.找到插入位置】class Solution {
public:
int searchInsert(vector& nums, int target) {
int i;
int flag=0;
for ( i=0; i{
if (target <= nums[i])
{
return i;
}
}
return i;
}
};

    推荐阅读