Rust: 0ms - Short O(n)
rust\nimpl Solution {\n    pub fn construct_array(n: i32, k: i32) -> Vec<i32> {\n        (1..=k + 1)\n            .rev()\n            .scan((k + 2, -1), |s, x| 
```rust\nimpl Solution {\n    pub fn construct_array(n: i32, k: i32) -> Vec<i32> {\n        (1..=k + 1)\n            .rev()\n            .scan((k + 2, -1), |s, x| {\n                s.0 += x * s.1;\n                s.1 *= -1;\n                Some(s.0)\n            })\n            .chain(k + 2..=n)\n            .collect()\n    }\n}\n```
['Rust']