feat: 35_search_insert_position

This commit is contained in:
SquidSpirit 2025-02-17 23:16:17 +08:00
parent 96f51b0ae3
commit 35a30abbf7

View File

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int searchInsert(vector<int>& nums, int target) {
auto iter = lower_bound(nums.begin(), nums.end(), target);
return iter - nums.begin();
}
};