JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Success stories
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • groupBy: get Map<K, List<V>> and read groups

    Kotlin SELF
    24 level,0 lecture
    We break down how to work with collection grouping in Kotlin via groupBy: why the result is Map<K, List<T>>, how to read groups safely (iteration and lookup by key with ?:), how to normalize keys ( trim()/ lowercase()), and how to use the overload groupBy(keySelector, valueTransform) to store only the data you actually need inside the groups.
    Open
  • groupingBy().eachCount() — counting frequencies without group lists

    Kotlin SELF
    24 level,1 lecture
    We break down how to count frequencies in Kotlin (how many times a key occurs) without extra lists: how groupBy differs from groupingBy, why groupingBy returns not a Map but a “grouping plan,” and how a single operation eachCount() produces a ready-made frequency map Map<K, Int>. In practice, we count the number of expenses by category while normalizing the key via trim() and lowercase(), and we review typical mistakes.
    Open
  • Post-processing results — mapValues, sorting, and output preparation

    Kotlin SELF
    24 level,2 lecture
    We cover the typical “last mile” when working with grouping results in Kotlin: how to turn groupBy into a summary via mapValues, when it’s better to use groupingBy().eachCount(), how to sort maps via entries (by key and by value), select top‑N with take, and then assemble a human-readable report using joinToString and StringBuilder with column alignment ( padEnd/ padStart). At the end, there’s a set of common mistakes and how to avoid them.
    Open
  • Practical walkthrough: word frequencies

    Kotlin SELF
    24 level,3 lecture
    We build a mini text analyzer in Kotlin: we assemble a pipeline “normalization → tokenization → frequencies → sorting/output”, carefully bring keys to a uniform form via trim() and lowercase(), count frequencies in one line with groupingBy + eachCount(), and then print the Top‑N with descending sorting.
    Open
  • Groupings in reports: list by key and counter by key

    Kotlin SELF
    24 level,4 lecture
    We break down two basic “result formats” for collection-based reports: detailed output via groupBy ( Map key → List) and a summary via groupingBy + eachCount() ( Map key → number). We learn to normalize keys ( trim(), lowercase()), format output with StringBuilder, sort by entries, and connect reports to CLI commands.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success stories
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush