Write catalog title here
1. Title description
2. Problem solving ideas
Brute force method, directly traverse the sorted array, find the subscript of the target value in the array or the subscript of the insertion position.
3. Code implementation
class Solution {
public int searchInsert(int[] nums, int target) {
for(int i=0;i<nums.length;i++){
if(nums[i]>=target)
return i;
}
return nums.length;
}
}