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

Method sum

677-map-sum-pairs.rs:28–36  ·  view source on GitHub ↗
(&mut self, prefix: String)

Source from the content-addressed store, hash-verified

26 }
27
28 fn sum(&mut self, prefix: String) -> i32 {
29 let mut ret = 0;
30 for (k, v) in &self.mmp {
31 if k.starts_with(&prefix) {
32 ret += v;
33 }
34 }
35 ret
36 }
37}
38
39fn main() {

Callers 8

count_negativesFunction · 0.80
max_ascending_sumFunction · 0.80
add_digitsFunction · 0.80
get_minimum_timeMethod · 0.80
min_countFunction · 0.80
count_metaFunction · 0.80
cal_pointsFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected