easy understanding
Intuition\n---\n\n1 2 3 4 5 6\nk = 5 ... 1 6 2 5 3 4 \nk = 4 ... 6 1 5 2 3 4\nk = 3 ... 1 6 2 3 4 5\nk = 2 ... 6 1 2 3 4 5\nk = 1 ... 1 2 3 4 5 6\n\n---\n1 2 3 
# Intuition\n---\n\n1 2 3 4 5 6\nk = 5 ... 1 6 2 5 3 4 \nk = 4 ... 6 1 5 2 3 4\nk = 3 ... 1 6 2 3 4 5\nk = 2 ... 6 1 2 3 4 5\nk = 1 ... 1 2 3 4 5 6\n\n---\n1 2 3 4 5 6 7\nk = 6 ... 7 1 6 2 5 3 4\nk = 5 ... 1 7 2 6 3 4 5\nk = 4 ... 7 1 6 2 3 4 5\nk = 3 ... 1 7 2 3 4 5 6\nk = 2 ... 7 1 2 3 4 5 6\nk = 1 ... 1 2 3 4 5 6 7\n\n---\n\n# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(n)$$\n\n# Code\n```\nclass Solution:\n    def constructArray(self, n: int, k: int) -> List[int]:\n        number_tail = k // 2\n        start, end = [i for i in range(1, n - number_tail + 1)], [i for i in range(n, n - number_tail, -1)]\n        i, j = 0, 0\n        if k % 2 == 0:\n            start, end = end, start\n        answer = []\n        for i, j in zip(start, end):\n            answer.append(i)\n            answer.append(j)\n        if len(start) > len(end):\n            for i in range(len(end), len(start)):\n                answer.append(start[i])\n        if len(start) < len(end):\n            for i in range(len(start), len(end)):\n                answer.append(end[i])\n        return answer\n        \n\n```
['Python3']