Commit 19607155 authored by yaozc's avatar yaozc
Browse files

35 solved

parent a2e11c1d
......@@ -88,3 +88,15 @@ int strStr(string haystack, string needle) {
}
return -1;
}
// 35. Search Insert Position
// way tooo easy
int searchInsert(vector<int>& nums, int target) {
for(int i=0; i<nums.size(); i++){
if(nums[i] >= target){
return i;
}
}
return nums.size();
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment