Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/StudyRust/leetcode_rust
/ shuffle
Function
shuffle
1470-shuffle-the-array.rs:17–24 ·
view source on GitHub ↗
(nums: Vec<i32>, n: i32)
Source
from the content-addressed store, hash-verified
15
}
16
17
pub fn shuffle(nums: Vec<i32>, n: i32) -> Vec<i32> {
18
let mut res = vec!();
19
for i in 0..n {
20
res.push(nums[i as usize]);
21
res.push(nums[((i as i32)+n) as usize]);
22
}
23
res
24
}
Callers
1
main
Function · 0.85
Calls
1
push
Method · 0.45
Tested by
no test coverage detected