Skip to content

Search Insert Position - Easy Problem #5

@AkP2809

Description

@AkP2809

Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.

You must write an algorithm with O(log n) runtime complexity.

Example 1:
Input: nums = [1,3,5,6], target = 5
Output: 2

Example 2:
Input: nums = [1,3,5,6], target = 2
Output: 1

Go to folder : C++/Java/Py
Give today's date
Take your GitHUB username id like "AkP2809", etc which you have.
File extension = .cpp/.java/.py in this issue.
Combine all 3 to get your file name : Problem Name + "_" + Username + File Extension, ex. "ReverseInteger_AkP2809.cpp".
Create this file in above mentioned folder only "/C++/".

This will ensure no file will be conflict and any number of contributors can work on the same issue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions