public int searchInsert(int[] nums, int target) {
for(int i=0;i<nums.length;i++){
if(nums[i] <= target)
if(nums[i] == target)
return i;
else
return i+1;
else
return i;
}
}
In this case, added return statement for each if and else, I still get the same error. Can you please help here!