You must write an algorithm with O(log n) runtime complexity? What does this mean? So the question was "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"
Here is my code:
if target in nums:
    print(nums.index(target))
else:
    nums.append(target)
    nums.sort()
    print(nums.index(target))
 
    