Skip to content

Hashing-1 isIsomorphic Hw#2260

Open
Amaan-29 wants to merge 3 commits intosuper30admin:masterfrom
Amaan-29:master
Open

Hashing-1 isIsomorphic Hw#2260
Amaan-29 wants to merge 3 commits intosuper30admin:masterfrom
Amaan-29:master

Conversation

@Amaan-29
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  1. Correct implementation of the problem solution.
  2. Good use of HashMap to group anagrams efficiently.
  3. Clear and concise code with appropriate comments.
  4. Proper handling of edge cases (implicitly through the general approach).

Areas for Improvement:

  1. The time complexity could be improved by using a more efficient hashing method, such as the prime number multiplication approach used in the reference solution, which avoids the sorting step.
  2. The method could be made more concise by directly adding the string to the map's list without intermediate steps (e.g., map.computeIfAbsent(sorted, k -> new ArrayList<>()).add(curr);).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants