Easy idiomatic Go solution. Beats 100%. 0ms
\nfunc constructArray(n int, k int) []int {\n\tresult := make([]int, 0, n)\n\tleft, right := 1, n\n\tfor ; left < n-k; left++ {\n\t\tresult = append(result, lef
```\nfunc constructArray(n int, k int) []int {\n\tresult := make([]int, 0, n)\n\tleft, right := 1, n\n\tfor ; left < n-k; left++ {\n\t\tresult = append(result, left)\n\t}\n\tfor i := 0; i <= k; i++ {\n\t\tif i%2 == 0 {\n\t\t\tresult, left = append(result, left), left+1\n\t\t} else {\n\t\t\tresult, right = append(result, right), right-1\n\t\t}\n\t}\n\n\treturn result\n}\n```
['Go']