667. Beautiful Arrangement II
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 constructArray(self, n: int, k: int):
        result = list(range(1, n - k))
        left, right = n - k, n
        for i in range(k + 1):
            if i % 2 == 0:
                result.append(left)
                left += 1
            else:
                result.append(right)
                right -= 1
        return result

```
['Python3']