dsa1 min read
Jewels and Stones [Easy] — HashSet Membership
Count how many stones are jewels by storing jewel types in a HashSet and checking each stone.
Read →
webcoderspeed.com
1276 articles
Count how many stones are jewels by storing jewel types in a HashSet and checking each stone.
Find all groups of duplicate files by parsing path strings and grouping files by their content using a HashMap.
Group strings that are anagrams together by using their sorted form as a HashMap key.
Find the k most frequent elements in O(n) using bucket sort by frequency instead of a heap.
Design a Least Recently Used cache with O(1) get and put operations using a HashMap combined with a doubly linked list.