My 4 line AC code in C


  • -1
    Z
    int searchInsert(int* nums, int numsSize, int target) {
        for (int i = 0; i < numsSize; ++i) if (target <= nums[i]) return i;
        return numsSize;
    }

Log in to reply
 

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