C++ O(N) (1,k-1)(2,k-2)(3,k-3).....
\nclass Solution {\npublic:\n    vector<int> constructArray(int n, int k) {\n        vector<int> res;\n        int start = 1 , end = k+1;\n        while(start <
```\nclass Solution {\npublic:\n    vector<int> constructArray(int n, int k) {\n        vector<int> res;\n        int start = 1 , end = k+1;\n        while(start < end){\n            res.push_back(start++);\n            res.push_back(end--);\n        }\n        if(start == end){\n            res.push_back(start);\n        }\n        for(int i = k+2;i <= n;i++){\n            res.push_back(i);\n        }\n        return res;\n    }\n};\n```
[]