dsa2 min read
Palindrome Pairs — HashMap + Palindrome Check
Find all index pairs forming palindromes by checking prefix/suffix splits against a reverse-word map.
Read →
webcoderspeed.com
1276 articles
Find all index pairs forming palindromes by checking prefix/suffix splits against a reverse-word map.
Complete cheatsheet for Hashing & Maps: all 7 patterns, Big O reference, template code, and MAANG priority guide.
Master heaps and priority queues: 7 core patterns including Top K, Two Heaps, Merge K, and scheduling problems.
Maintain a min-heap of size K to track the Kth largest element as numbers are added to a stream.
Simulate stone smashing by repeatedly extracting the two heaviest stones using a max-heap.