Back to Browse

LeetCode #677. Map Sum Pairs - HashMap & Tries Based Approach

349 views
Aug 2, 2021
12:06

Implement the MapSum class: MapSum() Initializes the MapSum object. void insert(String key, int val) Inserts the key-val pair into the map. If the key already existed, the original key-value pair will be overridden to the new one. int sum(string prefix) Returns the sum of all the pairs' value whose key starts with the prefix. LeetCode Reference: https://leetcode.com/problems/map-sum-pairs/ Tries Data Structure: https://youtu.be/D1TZeARS2jo Other LeetCode Problems: Binary Tree Right Side View: https://youtu.be/qSShcrIrdUw House Robber | Dynamic Programing: https://youtu.be/NAdwES8C48g Generate Parentheses: https://youtu.be/FrTsckBmdyM Maximum Subarray Sum | Kadane's Algorithm: https://youtu.be/8HUTuitR65s Find All Duplicates in an Array: https://youtu.be/5wdQI88O3Mc #MapSumPair #HashTries #LeetCode677 #Google #Microsoft #Amazon #Facebook

Download

1 formats

Video Formats

360pmp415.4 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

LeetCode #677. Map Sum Pairs - HashMap & Tries Based Approach | NatokHD