Advertisement
momo2345

search insert position

Aug 31st, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. class Solution {
  2. public:
  3.     int searchInsert(vector<int>& nums, int target) {
  4.         int l=lower_bound(nums.begin(),nums.end(),target)-nums.begin();
  5.         return l;
  6.     }
  7. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement