leetcode35 C++ 4ms 搜索插入位置
生活随笔
收集整理的這篇文章主要介紹了
leetcode35 C++ 4ms 搜索插入位置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
class Solution {
public:int searchInsert(vector<int>& nums, int target) {for(int i =0;i<nums.size();i++){if(nums[i] >= target){return i;}}return nums.size()-1;}
};
轉載于:https://www.cnblogs.com/theodoric008/p/9449049.html
總結
以上是生活随笔為你收集整理的leetcode35 C++ 4ms 搜索插入位置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 华为Mate 50系列首发应急模式:电量
- 下一篇: 刀片电池已被特斯拉相中 比亚迪再投近30