MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / pick

Method pick

398-random-pick-index.rs:19–22  ·  view source on GitHub ↗
(&mut self, target: i32)

Source from the content-addressed store, hash-verified

17 }
18
19 fn pick(&mut self, target: i32) -> i32 {
20 self.mmp.get_mut(&target).unwrap().rotate_right(1);
21 self.mmp[&target][0] as i32
22 }
23}
24
25fn main() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected