Skip to content

Conversation

@Ekarry
Copy link
Owner

@Ekarry Ekarry commented Jun 1, 2021

Перезалила, чтобы не было "мусора"


public HashSet<String> get(String surname) {
if (phonebook.containsKey(surname))
return phonebook.get(surname);

Choose a reason for hiding this comment

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

{ }

public HashSet<String> get(String surname) {
if (phonebook.containsKey(surname))
return phonebook.get(surname);
return new HashSet<>(Collections.singletonList(""));

Choose a reason for hiding this comment

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

тут просто HashSet()

System.out.println("Уникальные слова: " + wordsSet);

for (String word : wordsSet) {
int number = Collections.frequency(wordsList, word);

Choose a reason for hiding this comment

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

хитро!

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.

3 participants