Skip to content

677. Map Sum Pairs #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2019
Merged

677. Map Sum Pairs #75

merged 1 commit into from
Feb 12, 2019

Conversation

zwfang
Copy link
Collaborator

@zwfang zwfang commented Feb 1, 2019

https://leetcode.com/problems/map-sum-pairs/

Implement a MapSum class with insert, and sum methods.

For the method insert, you'll be given a pair of (string, integer).
The string represents the key and the integer represents the value.
If the key already existed, then the original key-value pair will be overridden to the new one.

For the method sum, you'll be given a string representing the prefix,
and you need to return the sum of all the pairs' value whose key starts with the prefix.

@zwfang zwfang added Medium Coefficient of difficulty medium Trie trie,又称前缀树或字典树,是一种有序树,用于保存关联数组,其中的键通常是字符串。 labels Feb 1, 2019
@codecov
Copy link

codecov bot commented Feb 1, 2019

Codecov Report

Merging #75 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #75      +/-   ##
==========================================
+ Coverage   99.34%   99.35%   +0.01%     
==========================================
  Files         112      113       +1     
  Lines        1951     1972      +21     
==========================================
+ Hits         1938     1959      +21     
  Misses          9        9              
  Partials        4        4
Impacted Files Coverage Δ
src/0677_map_sum_pairs/map_sum_pairs.go 100% <100%> (ø)
src/0208_implement_trie_prefix_tree/impltrie.go 100% <100%> (ø) ⬆️

@zwfang zwfang merged commit 69a8cb0 into master Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Coefficient of difficulty medium Trie trie,又称前缀树或字典树,是一种有序树,用于保存关联数组,其中的键通常是字符串。
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant