dsa2 min read
Greedy & Monotonic Stack — Master Recap & Cheatsheet
Complete Greedy and Monotonic Stack cheatsheet: all patterns, templates, complexity table, and problem index.
Read →
webcoderspeed.com
1276 articles
Complete Greedy and Monotonic Stack cheatsheet: all patterns, templates, complexity table, and problem index.
Master HashMap, HashSet, and cache design patterns with 45 problems, 5-language solutions, and MAANG company tags.
Find two indices that add to target in O(n) by storing each number in a HashMap and looking up the complement.
Check if two strings are anagrams by comparing their character frequency counts using an array or HashMap.
Check if a ransom note can be constructed from magazine letters using a character frequency map.