leetcode
34. Find First and Last Position of Element in Sorted Array
Solution
Python code
Java code
Time complexity: O(log(n))
Space complexity: O(1)