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

Method pop

225-implement-stack-using-queues.rs:16–21  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

14 }
15
16 fn pop(&mut self) -> i32 {
17 let index = self.stack_box.len()-1;
18 let ret = self.stack_box[index];
19 self.stack_box.remove(index);
20 ret
21 }
22
23 fn top(&self) -> i32 {
24 *self.stack_box.last().unwrap()

Callers 1

mainFunction · 0.45

Calls 1

removeMethod · 0.45

Tested by

no test coverage detected