3 Lines Python
def constructArray(self, n, k):\n        res = range(1, n+1)\n        for i in range(2, k+1): res = res[:i-1] + res[i-1:][::-1]\n        return res\n\nExample: 
    def constructArray(self, n, k):\n        res = range(1, n+1)\n        for i in range(2, k+1): res = res[:i-1] + res[i-1:][::-1]\n        return res\n\nExample: n = 7\nk = 1, 1234567\nk = 2, 1765432\nk = 3, 1723456\n....
[]