Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/StudyRust/leetcode_rust
/ decode
Function
decode
1720-decode-xored-array.rs:15–23 ·
view source on GitHub ↗
(encoded: Vec<i32>, first: i32)
Source
from the content-addressed store, hash-verified
13
}
14
15
pub fn decode(encoded: Vec<i32>, first: i32) -> Vec<i32> {
16
let mut res = vec!(first);
17
let mut temp = first;
18
for num in encoded {
19
temp = temp ^ num;
20
res.push(temp);
21
}
22
res
23
}
Callers
nothing calls this directly
Calls
1
push
Method · 0.45
Tested by
no test coverage detected