leetcode
35. Search Insert Position
Solution
Python code
Java code
Time complexity: O(log(n))
Space complexity: O(1)