搜索插入位置

109 阅读1分钟
public int searchInsert(int[] A, int target) {
        // write your code here
        int i=0;
        for(; i<A.length;i++){
            if(A[i]>=target){
                break;
            }
        }

        return i;
    }