Skip to content

anagram solution Stefan - #21

Open
Hubbacca wants to merge 1 commit into
ibwgr:masterfrom
Hubbacca:loesung-anagram
Open

anagram solution Stefan#21
Hubbacca wants to merge 1 commit into
ibwgr:masterfrom
Hubbacca:loesung-anagram

Conversation

@Hubbacca

Copy link
Copy Markdown

No description provided.

Comment on lines +39 to 43
public String getSortedWord(String word) {
char [] letters = word.toLowerCase().toCharArray();
Arrays.sort(letters);
return new String(letters);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gute Idee mit der Methode fürs Sortieren der Wörter, dadurch reduzierst du doppelten Code. Könnte ich in meiner Lösung auch noch machen.

return null;

List <String> anagrams = new ArrayList<>();
String sortedWord = getSortedWord(word);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evtl. könntest du diesen Schritt bereits im Konstruktor ausführen.

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