Challenge: Search Position
Given a sorted list and a target value, return the index of the target value if the value is present in the list. If the value is not present, return the index at which the value should be inserted.
You may assume that no duplicates are in the list.
A sorted list and a target value
The index at which the list should be inserted OR the index at which it is already present
lst = [1, 3, 5, 6]
value = 5
result = 2
First, take a close look at this problem and design a step-by-step algorithm before jumping to the implementation. This problem is designed for your practice, so try to solve it on your own first. If you get stuck, you can always refer to the solution provided in the solution section. Good luck!