GroupBy for categorization
📖 Scenario: You work in a bookstore. You have a list of books with their genres. You want to group the books by their genre to organize the store better.
🎯 Goal: Build a Kotlin program that groups a list of books by their genre using groupBy.
📋 What You'll Learn
Create a list of books with exact titles and genres
Create a variable to hold the grouped books
Use
groupBy to group books by genrePrint the grouped books
💡 Why This Matters
🌍 Real World
Grouping items by categories is common in organizing data, like sorting books by genre in a bookstore.
💼 Career
Understanding how to group data helps in data analysis, reporting, and building features like filters in apps.
Progress0 / 4 steps