[Python3] greedy
\n\nclass Solution:\n    def constructArray(self, n: int, k: int) -> List[int]:\n        lo, hi = 1, n \n        ans = []\n        while lo <= hi: \n           
\n```\nclass Solution:\n    def constructArray(self, n: int, k: int) -> List[int]:\n        lo, hi = 1, n \n        ans = []\n        while lo <= hi: \n            if k&1: \n                ans.append(lo)\n                lo += 1\n            else: \n                ans.append(hi)\n                hi -= 1\n            if k > 1: k -= 1\n        return ans \n```
['Python3']