Skip to content

Add “Anagram Grouping Program” in Java #149

@Rik-web-fullstack

Description

@Rik-web-fullstack

Create a Java program that groups a list of words that are anagrams of each other.

Example:
Input → ["eat", "tea", "tan", "ate", "nat", "bat"]
Output → [["eat", "tea", "ate"], ["tan", "nat"], ["bat"]]

Task:

  • Implement the solution in Java (algorithms/AnagramGrouping.java).
  • Use a HashMap where the key is the sorted version of each word, and the value is a list of all words matching that key.
  • Return the grouped anagrams as a list of lists.
  • Add clear comments explaining each step.
  • Include one sample test case in the main() function for demonstration.

Hey @SilvaneUX

Can you please assign this issue under Hacktoberfest 2025? 🚀

Metadata

Metadata

Labels

help wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions