Ugly Ruby "one-liner"
Code
# Code
```ruby []
# @param {Integer} n
# @param {Integer} k
# @return {Integer[]}
def construct_array(n, k)
  x = 1 + k / 2; (0...k).zip([1,-1].rotate(k % 2).cycle).map { x += _1 *
_2 }.concat(((k+1)..n).to_a)  
end
```
['Ruby']