Maps & Sets
Store key-value pairs and unique collections. Learn maps and sets for lookups and deduplication.
Lessons
1. Intro
Section Overview
2. What is a Map?
Basic concept
3. Creating Maps
How to declare
4. Inserting Elements
How to add entries
5. Quiz: Map Insertion
Knowledge check
6. Accessing Elements
How to get values
7. Checking Key Existence
Does key exist?
8. Quiz: Key-value storage
Key-value storage
9. Iterating Over Maps
Processing all entries
10. Quiz: Map Iteration
Test your understanding
11. Erasing Elements
Deleting map entries
12. Map vs Unordered Map
Two map types
13. Quiz: Key-value storage
Key-value storage
14. Quiz: Map Choice
Knowledge check
15. What is a Set?
Collection basics
16. Creating Sets
How to declare
17. Quiz: Unique elements
Unique elements
18. Inserting into Sets
How to add
19. Checking Membership
Is element present?
20. Quiz: Unique elements
Unique elements
21. Quiz: Set Membership
Knowledge check
22. Iterating Over Sets
Processing elements
23. Erasing from Sets
How to delete
24. Quiz: Unique elements
Unique elements
25. Set vs Unordered Set
Two set types
26. Multiset
Non-unique sets
27. Quiz: Unique elements
Unique elements
28. Multimap
Non-unique maps
29. Lower and Upper Bound
Finding ranges
30. Quiz: Key-value storage
Key-value storage
31. Quiz: Set Operations
Knowledge check
32. Frequency Counting
Counting occurrences
33. Deduplication
Unique elements only
34. Quiz: Key-value storage
Key-value storage
35. Two Sum Problem
Classic problem
36. Unique Characters
Character tracking
37. Group Anagrams
Grouping pattern
38. Quiz: Problem Solving
Knowledge check
39. Custom Comparators
Custom sorting
40. Problem - Boy or Girl
Using sets for uniqueness
41. Boy or Girl - The Idea
Automatic deduplication
42. Boy or Girl - Algorithm
Breaking it down
43. Quiz: Key-value storage
Key-value storage
44. Boy or Girl - Implementation
Complete solution
45. Lessons from Boy or Girl
summary
46. Problem - Registration System
Using maps for counting
47. Registration - The Idea
Counting occurrences
48. Registration - Algorithm
Breaking it down
49. Quiz: Key-value storage
Key-value storage
50. Registration - Implementation
Complete solution
51. Lessons from Registration
summary
52. Section Recap
What we learned