Search Insert Position

来源:互联网 发布:mysql 新增数据库 编辑:程序博客网 时间:2024/06/08 03:11

https://oj.leetcode.com/problems/search-insert-position/


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


0 0