LeetCodeAnimation/0035-search-insert-position/Code/1.java
2020-05-06 10:30:06 +08:00

11 lines
228 B
Java
Executable File

class Solution1 {
public int searchInsert(int[] nums, int target) {
int i=0;
for(;i<nums.length;i++){
if (nums[i]>=target){
break;
}
}
return i;
}
}