Time complexity: O(log(n - k) + k)
Space complexity: O(1)
Runtime 3 ms Beats 99.29% Memory 46.47 MB Beats 6.03%