```
class Solution {
public:
int searchInsert(vector<int>& nums, int target)
{
unsigned int i = 0;
unsigned int n = nums.size();
while(i < n && nums[i] < target)
{
i++;
}
return i;
}
};
```