Sets

Learn what sets are, how to write them, and set operations: union, intersection, and difference.

41 lessons
134 min
Codeforces: 900-1300LeetCode: 1300-1500

Lessons

1. Intro

Why sets matter

2m

2. What Is a Set?

Unordered unique collection

4m

3. Set Notation

Curly braces

4m

4. Vocabulary - Element

Member of a set

3m

5. Empty Set

Set with nothing

3m

6. Set-Builder Notation

Defining with rules

4m

7. Vocabulary - Cardinality

Number of elements

3m

8. Vocabulary - Subset

All elements contained

4m

9. Proper Subset

Subset but not equal

3m

10. Set Equality

Same elements

3m

11. Vocabulary - Union

Combine both sets

4m

12. Vocabulary - Intersection

Common elements only

4m

13. Vocabulary - Difference

Elements in first only

3m

14. Vocabulary - Complement

Everything not in set

4m

15. Symmetric Difference

Either set not both

4m

16. Venn Diagrams

Visual representation

4m

17. Power Set

Set of all subsets

3m

18. De Morgan's Laws

Complement identities

3m

19. Sets in Programming

Hash sets and tree sets

4m

20. Quiz: Set Basics

Knowledge check

2m1 problems

21. Problem - Intersection of Two Arrays

LeetCode 349

2m1 problems

22. Intersection - The Idea

Membership check

4m

23. Intersection - Implementation

Hash set solution

5m1 problems

24. Lessons from Intersection

summary

2m

25. Problem - Find Difference

LeetCode 2215

2m1 problems

26. Difference - The Idea

Two-way difference

4m

27. Difference - Implementation

Two set subtractions

5m1 problems

28. Lessons from Difference

summary

2m

29. Quiz: Set Operations

Knowledge check

2m1 problems

30. Problem - Set Mismatch

LeetCode 645

2m1 problems

31. Mismatch - The Idea

Frequency tracking

4m

32. Mismatch - Implementation

Frequency array

5m1 problems

33. Lessons from Mismatch

summary

2m

34. Problem - Longest Consecutive

LeetCode 128

2m1 problems

35. Consecutive - Core Idea 1

Start of sequence

4m

36. Consecutive - Core Idea 2

Counting forward

4m

37. Consecutive - Implementation

Smart iteration

5m1 problems

38. Lessons from Consecutive

summary

2m

39. Quiz: Advanced Sets

Knowledge check

2m1 problems

40. When to Use Sets

Problem patterns

4m

41. Section Recap

What we learned

2m

Ready to start learning?

Access all 41 lessons with interactive content and progress tracking.