Super easy intuitive sliding window solution - python
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def findClosestElements(self, arr: List[int], k: int, x: int) -> List[int]:
        l = 0
        ret = deque(arr[:k])
        for r in range(k, len(arr)):
            if abs(arr[r] - x) < abs(arr[l] - x):
                l += 1
                ret.popleft()
                ret.append(arr[r])
        
        return list(ret)

```
['Python3']