Search lnsert Position


  • 0
    H
    public class SearchInsertPosition35 {
         public int searchInsert(int[] nums, int target) {
    	     int index=0;
    	     for(; index < nums.length; index++)
    	     {
    	    	 if(target <= nums[index])
    	    		 break;
    	     }
    	     
        	 return index;       
         }
    }
    
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.