dsa2 min read
Encode and Decode TinyURL — HashMap Bidirectional Mapping
Design a URL shortener using two hash maps for O(1) encode and decode operations.
Read →
webcoderspeed.com
1276 articles
Design a URL shortener using two hash maps for O(1) encode and decode operations.
Convert a fraction to decimal string with recurring part detected via remainder position tracking.
Find all duplicate subtrees by serializing each subtree and tracking serialization counts in a hash map.
Implement a hash map from scratch using an array of buckets with chaining for collision resolution.
Implement a hash set from scratch supporting add, remove, and contains in O(1) average time.