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

Method insert

677-map-sum-pairs.rs:20–26  ·  view source on GitHub ↗
(&mut self, key: String, val: i32)

Source from the content-addressed store, hash-verified

18 }
19
20 fn insert(&mut self, key: String, val: i32) {
21 if let Some(x) = self.mmp.get_mut(&key) {
22 *x = val;
23 } else {
24 self.mmp.insert(key, val);
25 }
26 }
27
28 fn sum(&mut self, prefix: String) -> i32 {
29 let mut ret = 0;

Callers 15

number_of_linesFunction · 0.80
num_unique_emailsFunction · 0.80
add_numMethod · 0.80
two_out_of_threeFunction · 0.80
evaluateFunction · 0.80
add_spacesFunction · 0.80
get_word_mapFunction · 0.80
is_happyMethod · 0.80
find_even_numbersFunction · 0.80
array_rank_transformFunction · 0.80
check_validFunction · 0.80
count_pointsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected