Collections • Lesson 23/100
Sets
Collections with unique elements
📚
Learn💻
Code❓
Quiz🏆
Practice⭐
Complete📚 Lý thuyết
**Set** là collection chỉ chứa các phần tử duy nhất (không trùng lặp).
**Đặc điểm:**
- Tự động loại bỏ duplicates
- Không có thứ tự (trừ LinkedHashSet)
- Kiểm tra tồn tại nhanh O(1)
**Loại Set:**
- setOf() - Immutable
- mutableSetOf() - Mutable
- hashSetOf(), linkedSetOf(), sortedSetOf()