@@ -0,0 +1,940 @@
+public class SearchInsertPosition %7B%0A%09// find the 1st position %3E= target%0A    public static int searchInsert(int%5B%5D nums, int target) %7B%0A        int start = 0, end = nums.length-1;%0A        while(start + 1 %3C end) %7B%0A            int mid = start + (end - start) / 2;%0A            if(nums%5Bmid%5D == target)%0A                return mid;%0A            else if(nums%5Bmid%5D %3E target)%0A                end = mid;%0A            else%0A                start = mid;%0A        %7D%0A        %0A        if(nums%5Bstart%5D %3E= target)%0A            return start;%0A        if(nums%5Bend%5D %3E= target)%0A            return end;%0A        return end + 1;%0A        %0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A    %09int%5B%5D nums = %7B1,3,5,6%7D;%0A    %09System.out.println(searchInsert(nums, 5));%0A    %09System.out.println(searchInsert(nums, 2));%0A    %09System.out.println(searchInsert(nums, 7));%0A    %09System.out.println(searchInsert(nums, 0));%0A    %09System.out.println(searchInsert(new int%5B%5D%7B1%7D, 1));%0A    %7D%0A%7D

add search insert pos solution