mirror of
https://gitee.com/TheAlgorithms/LeetCodeAnimation.git
synced 2024-12-06 15:19:44 +08:00
11 lines
228 B
Java
Executable File
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;
|
|
}
|
|
} |